Mongodb's geoNear In Flask and Mongoengine -
i using flask , mongoengine. how use mongodb's geonear query?
i trying use pymongo using link:
db.command(son([('geonear', 'content'), ('near', coordinate)]))
if on right way.
how create pymongo's db object flask , mongoengine?
after reading sourcecode of mongoengine
in connection.py get_db return db object need
def get_db(alias=default_connection_name, reconnect=false):
so can run geonear in mongoengine this:
from mongoengine.connection import get_db get_db().command(son([('geonear', 'content'), ('near', coordinate)]))
Comments
Post a Comment