Exemple #1
0
 def aggregate(self):
     return Aggregation(self)
Exemple #2
0
    def aggregate(self, group_by, project=None, unwind=None, callback=None, alias=None):
        coll = self.coll(alias)

        agg = Aggregation(self, group=group_by, project=project, unwind=unwind)

        coll.aggregate(agg.to_query(), callback=agg.handle_aggregation(callback))