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

Modify $nearSphere documentation to be in line with $near for sharded collections

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual

    Description

      both $near and $nearSphere have the same behaviour for sharded collections:

      For sharded collections, queries using $near are not supported. You can instead use either the geoNear command or the $geoNear aggregation stage.
      

      However, this is not denoted in the documentation for $nearSphere (only $near, as above).

      Running $nearSphere on a sharded collection will result in:

      error: { "$err" : "use geoNear command rather than $near query", "code" : 13501 }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            andre.defrere@mongodb.com Andre de Frere
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 47 weeks ago