Most geo queries that are built on top of geometry_container do not allow an unknown or missing "type" field. However, $geoNear (match expression and agg stage) rely instead on `GeoNearExpression`, which skips the geometry_container layer, so it accepts a missing or invalid GeoJSON "type" field, and will treat it as type "Point". In fact, it would even accept the type field as any GeoJSON type, since it doesn't check the "type" field. This is misleading, and inconsistent with the other geo operators.
As part of this ticket, we should consider incorporating geometry_container as part of GeoNearExpression to match behavior parity across geo expressions.
- has to be done before
-
SERVER-86141 Audit calls to the geoParser and assert that assumptions of type are correct
- Backlog
- related to
-
SERVER-84630 $geoNear fails to re-parse when provided geometry type is invalid
- Closed