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

unable to $and multiple geospatial queries

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.0-rc1
    • Geo, Querying
    • None
    • ALL

    Description

      It looks like it has been fixed in 2.5.5 (https://jira.mongodb.org/browse/SERVER-4572)
      However, I'm using 2.6.0-rc2-pre- and the following query fails:

       
      db.main.find( { $and : [ { "coords": {"$geoWithin": {"$geometry": {"type":"Polygon", "coordinates": [[[-73.650458551013,41.01805351145],
                                                                                                            [-73.699751260364,41.01805351145],
                                                                                                            [-73.699751260364,40.988362588689],
                                                                                                            [-73.650458551013,40.988362588689],                                                                                                                                                                                       
                                                                                                            [-73.650458551013,41.01805351145]]]}}}},                         
                              {"coords":{"$near":{"$geometry":{"type":"Point","coordinates":[-73.6647,41.000732]}}, "$maxDistance":1609.3470878864}}] },               
                    {_id:1}
      );
       
      error: {
              "$err" : "Can't canonicalize query: BadValue geo near accepts just one argument when querying for a GeoJSON point. Extra field found: $maxDistance: 1609.3470878864",
              "code" : 17287
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            rookie7799 Pavel Baranov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: