-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
ALL
-
Description
The $geoNear aggregation stage produces a misleading error message when performing GeoJSON point queries with invalid coordinates. When the coordinates array in the near parameter is undefined or invalid (e.g. []), instead of indicating the coordinate validation issue, it incorrectly suggests there's a problem with having multiple arguments:{}
MongoServerError: geo near accepts just one argument when querying for a GeoJSON point. Extra field found: $maxDistance: 1337.0
This error message is confusing because:
1. The maxDistance parameter is valid and supported by $geoNear
2. The actual issue is the invalid coordinates array in the query
Expected Behaviour
The error message should clearly indicate that the coordinates array is invalid instead of suggesting the removal of a valid parameter (`maxDistance`).