Geospatial queries parameters orders

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.0.1
    • Component/s: None
    • Environment:
      Python 2.7.1
      Django non-rel 1.3
      MongoDB 2.0.1
      PyMongo 2.0.1
      Django Mongo DB Engine 0.4
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I was trying to execute a geospatial query to find the nearest documents from django using django mongo db engine:

      MyModel.objects.raw_query({'location' : {'$near' : [55.55632, 25.13522], '$maxDistance' : 0.01}})

      And kept getting "geo values have to be numbers" error, I couldn't find helpful resources about this problem, but when I tried to reverse the order of the dictionary it succeeded:

      MyModel.objects.raw_query({'location' : {'$maxDistance' : 0.01, '$near' : [55.55632, 25.13522]}})

              Assignee:
              Bernie Hackett
              Reporter:
              Abd Allah Diab
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: