Spring mongo 聚合函数
TypedAggregation<DemoEntity> aggregation = newAggregation(DemoEntity.class, match(match), group("name").count().as("total"), sort(Sort.Direction.ASC, "total"), skip(0), limit(3)); AggregationResults<DBObject> result = mongo.aggregate(aggregation, DBObject.class); DBObject obj = result.getRawResults();