Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2353

Misplaced $maxDistance inside of $near

      The $maxDistance operator is misplaced in the documentation for the $near operator. The syntax and GeoJSON example puts the $maxDistance operator inside of the $near document instead of within the $geometry document as it should be. Either placement works fine for MongoDB 2.4.x, but the syntax is more strict for >= 2.5. I believe the example should be:

      db.places.find( { loc : { $near :
                                { $geometry :
                                  { type : "Point" ,
                                    coordinates: [ 40 , 5 ] }
                                  $maxDistance : 500
                                },
                              }
                      } )
      

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            luke.lovett Luke Lovett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 10 weeks, 6 days ago