Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4572

Geospatial index cannot be used in $and criteria of a query?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • 2.0.2
    • 2.5.5
    • Geo, Querying
    • None

    Description

      Question posted on mongodb-user here http://groups.google.com/group/mongodb-user/browse_thread/thread/41173a4a2c62f0be

      Quick synopsis is I'm getting this error back from the shell

      Wed Dec 28 12:39:01 uncaught exception: error {
      "$err" : "can't find special index: 2d for: { $and:[ { geometry.centroid:

      { $near: [ -37.817532, 144.967148 ],$maxDistance: 5.0 }

      },

      { identity.type_name: \"airport\" }

      ] }",
      "code" : 13038

      when using $near on a geospatial index in an $and query. Pulling the $near outside the $and gets the expected behavior.

      I can't see any caveats in the docs on geospatial queries or $and that indicates any restrictions here.

      Attachments

        1. SERVER-4572.js
          0.5 kB
          William Zola

        Issue Links

          Activity

            People

              Votes:
              17 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: