Aggregation: $geoNear
31/34
Example with $geoIntersects
Aggregation: $geoNear example
•
MongoDB's aggregation framework has as
$geoNear
pipeline operator
•
Also adds the
distance
as a new field to the document
•
Has to be the first operator in the pipeline
•
Only works if there is
one
2dsphere index