The 'cursor' option is required, except for aggregate with the explain argument 错误处理
这些天在用mongodb,get到了一个看起来很好用的技能.使用mongoTemplate.aggregate来进行查询,就不用麻烦的纠结mongodb的语句怎么写的了.用法如下:
//匹配对应postId,星级在1-5之间的数据,求平均值
TypedAggregation<Reply> aggregation = Aggregation.newAggregation(
...
原创
2018-03-07 11:14:14 ·
15550 阅读 ·
4 评论