Use MongoEngine and PyMongo together Use MongoEngine and PyMongo together mongodb mongodb

Use MongoEngine and PyMongo together


Author of MongoEngine here - MongoEngine is built upon pymongo so of course you can drop into pymongo - or use raw pymongo in your code!

There are some document helpers that allow you to access raw pymongo methods in MongoEngine eg:

class Person(Document):    name = StringField()# Access the pymongo collection for the Person documentcollection = Person._get_collection()collection.find_one()  # Use raw pymongo to query data