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

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                5 years, 43 weeks, 2 days ago
                Date of 1st Reply: