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

geoNear won't accept GeoJSON structure

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

      Simple geoNear query with a GeoJSON Point as near value.

      db.runCommand({ geoNear : "retail" , near : { type : "Point" , coordinates :  [40.45500000000228 , -3.7269999999] } })
      

      Response:

      {
      	"ns" : "test.retail",
      	"errmsg" : "exception: geo values have to be numbers :: caused by :: { 0: \"Point\", 1: [ 40.45500000000228, -3.7269999999 ] }",
      	"code" : 13026,
      	"ok" : 0
      }
      

      Same query with legacy point structure:

      db.runCommand({ geoNear : "retail" , near : [40.45500000000228 , -3.7269999999]})
      

      Response:

      {
      	"ns" : "test.retail",
      	"near" : "1001011111110001101100010110000111000010100110111000",
      	"results" : [
      ...
      }
      

            Assignee:
            dan@mongodb.com Daniel Pasette (Inactive)
            Reporter:
            penela Víctor Penela
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: