slides/mongodb/geo-aggregation.xml
Aggregation: $geoNear
16/19
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