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

$near errors on MultiPoint $geometry query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.10
    • Component/s: Geo
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I have following indexes:

      > db.world_map.getIndexes()
      [
              {
                      "v" : 1,
                      "key" : {
                              "_id" : 1
                      },
                      "name" : "_id_",
                      "ns" : "ws.world_map"
              },
              {
                      "v" : 1,
                      "key" : {
                              "coord" : "2dsphere"
                      },
                      "name" : "coord_2dsphere",
                      "ns" : "ws.world_map",
                      "2dsphereIndexVersion" : 2
              }
      ]
      

      Get error on queries:

      > db.world_map.find({'coord': {'$near': {'$minDistance': 4000, '$geometry': {'type': 'MultiPoint', 'coordinates': [[35.0, 25.0675], [35.03375, 25.045]]}, '$maxDistance': 10000}}})
      Error: error: {
              "$err" : "Can't canonicalize query: BadValue invalid point in geo near query $geometry argument: { type: \"MultiPoint\", coordinates: [ [ 35.0, 25.0675 ], [ 35.03375, 25.045 ] ] }  Point must only contain numeric elements",
              "code" : 17287
      }
      
      > db.world_map.find({'coord': {'$near': {'$geometry': {'type': 'MultiPoint', 'coordinates': [[35.0, 25.0675], [35.03375, 25.045]]}}}})
      Error: error: {
              "$err" : "Can't canonicalize query: BadValue invalid point in geo near query $geometry argument: { type: \"MultiPoint\", coordinates: [ [ 35.0, 25.0675 ], [ 35.03375, 25.045 ] ] }  Point must only contain numeric elements",
              "code" : 17287
      }
      
      > db.world_map.find({'coord': {'$near': {'$geometry': {'type': 'MultiPoint', 'coordinates': [[35.0, 25.0675]]}}}})
      Error: error: {
              "$err" : "Can't canonicalize query: BadValue invalid point in geo near query $geometry argument: { type: \"MultiPoint\", coordinates: [ [ 35.0, 25.0675 ] ] }  Point must only contain numeric elements",
              "code" : 17287
      }
      

      Also I found report about the same issue: https://groups.google.com/forum/#!msg/mongodb-user/58FURF8-_Vs/b3ufnu146tkJ

            Assignee:
            Unassigned Unassigned
            Reporter:
            davo David Jhanyan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: