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

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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual
    • Labels:

      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 }
      

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

              Created:
              Updated:
              Resolved:
              9 years, 6 weeks ago