-
Type: Task
-
Resolution: Fixed
-
Priority: Blocker - P1
-
Affects Version/s: None
-
Labels:None
$near, $nearSphere, and $geoNear are not allowed in agg pipelines. This can be confusing for users as they can use these operators in non-agg geo queries. We are editing the error message to better explain why these operators are not permitted in an agg context and suggest workarounds (notably, use $geoWithin in agg pipeline if they don't care about sort). You can follow the conversation on SERVER-57932.
We would like to have documentation describing the workarounds in more detail and link to this documentation in our error message.
- is depended on by
-
SERVER-57932 Improve error message for $near in aggregation to suggest workarounds
- Closed