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();
原文地址:https://www.cnblogs.com/wind90/p/4939696.html