I’m using Flask-MongoEngine in my python application, and I’m trying to grab a list of documents WHERE a field equals some value. I know how to grab a single document based on the value of a field using get(name=”chris”), but how would I be able to do this with returning multiple documents? Nothing in the docs is really sticking out.
I’m using Flask-MongoEngine in my python application, and I’m trying to grab a list
Share
MongoEngine Document classes have an objects attribute, which is used for accessing the objects in the database associated with the class. example:
For advanced queries you can use the filter attribute:
This is the related documentation MongoEngine – Querying the database