Open heynemann opened 10 years ago
Allow users to aggregate data using the new Aggregation Pipeline(http://docs.mongodb.org/manual/core/aggregation-pipeline/):
class Product(Document): type = StringField() location = StringField() price = FloatField() stocked = IntField() is_active = BooleanField() Document.objects.filter(is_active=True).order_by("type").aggregate( group_by=[Document.type, Document.location], price=Aggregation.add_to_set(Document.price), stocked=Aggregation.add_to_set(Document.stocked) )
The types of aggregation are in the following tickets:
Allow users to aggregate data using the new Aggregation Pipeline(http://docs.mongodb.org/manual/core/aggregation-pipeline/):
The types of aggregation are in the following tickets: