slides/mongodb/geo-aggregation.xml
Aggregation: $geoNear
35/39
$geoIntersects - example
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