Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5200 geo pages -- clarify unit of measurement for distance
  3. DOCS-5198

$near and $nearSphere documents incorrectly says that $minDistance is only support for 2dsphere indexes

    XMLWordPrintableJSON

Details

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • manual

    Description

      From http://docs.mongodb.org/manual/reference/operator/query/nearSphere/:

      The optional $minDistance is available only if the query uses the 2dsphere index. $minDistance limits the results to those documents that are at least the specified distance from the center point.

      From http://docs.mongodb.org/manual/reference/operator/query/near/

      $minDistance limits the results to those documents that are at least the specified distance from the center point. $minDistance is only available for use with 2dsphere index.

      But in my testing $minDistance does work with 2d indexes and legacy coordinate pairs.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 29 weeks ago