Warning
These APIs are available for MongoDB only, so using any of these features breaks portability to other non-relational databases (Google App Engine, Cassandra, Redis, ...). For the sake of portability you should try to avoid database-specific features whenever possible.
from django_mongodb_engine.contrib import MongoDBManager
class FooModel(models.Model):
...
objects = MongoDBManager()
>>> FooModel.objects.raw_query(...)
>>> FooModel.objects.raw_update(...)
Does a raw MongoDB query. The optional parameter query is the spec passed to PyMongo’s <Collection.find> pymongo.Collection.find().
Does a raw MongoDB update. spec_or_q is either a MongoDB filter dict or a Q instance that selects the records to update. update_dict is a MongoDB style update document containing either a new document or atomic modifiers such as $inc.
Keyword arguments will be passed to pymongo.Collection.update().
Runs a distinct() query against the database.