-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Fully Compatible
The $geoNear operator will be based on the geoNear command, supporting the same arguments with the same defaults as the command with the following exceptions:
1) Arguments are nested as in {$geoNear: {near:[10,20], spherical:true}}
2) limit is supported as a synonym for num (SERVER-5113).
3) num/limit can also be set by a following $limit
4) The matching documents are passed through the pipeline without a wrapper
5) A new required argument "distanceField" specifies a field name to inject the distance into. This could be optional on non-sharded systems, but I think it is best to require it everywhere.
6) includeLocs is still optional, but also takes a field to inject the location into.
geoNear command is documented here http://docs.mongodb.org/manual/reference/command/geoNear/
- depends on
-
SERVER-4656 aggregation: optimize sort/limit combination to only sort top-n items
- Closed
- is related to
-
SERVER-6531 support $within geo queries in aggregation
- Closed
- related to
-
SERVER-7842 geoNear command should support s2d indexes
- Closed