geoNear won't accept GeoJSON structure

XMLWordPrintableJSON

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

      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:
              Daniel Pasette (Inactive)
              Reporter:
              Víctor Penela
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: