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

Misplaced $maxDistance inside of $near

    XMLWordPrintable

    Details

    • # Replies:
      1
    • Last comment by Customer:
      true
    • Actual Time:
      4

      Description

      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
                                },
                              }
                      } )

        Attachments

          Activity

            People

            Assignee:
            kay.kim Kay Kim (Inactive)
            Reporter:
            luke.lovett Luke Lovett
            Participants:
            Last commenter:
            Jonathan Dahl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              6 years, 20 weeks, 1 day ago
              Date of 1st Reply: