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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -