Django has out-of-the-box support for aggregation. The following aggregations are currently supported by Django MongoDB Engine:
MongoDB’s group command is used to perform aggregations using generated Javascript code that implements the aggregation functions.
While being more flexible than Map/Reduce, a group command can not be processed in parallel, for which reason you should prefer Map/Reduce to process big data sets.
Warning
Needless to say, you shouldn’t use these aggregations on a regular basis (i.e. in your views or business logic) but regard them as a powerful tool for one-time operations.