I am using mongodb-engine to access MongoDB from a Django project. Normal get, insert and update works quite well, but now would I like to use the geoNear functionality. I can just not figure out a way to call it from Django.
I have tried MyModel.objects.raw(...)
and also MyModel.objects.raw_query(...)
, but the result is not really as expected.
The query will be something like this one (it works from the Mongo shell)
db.runCommand({ geoNear : "mymodel", near : [3, 0], spherical : true, maxDistance : 10 })
And the model uses MongoDBManager
class MyModel(model.Model):
objects = MongoDBManager()
...
has anyone successfully tried that?
Thx Simon