首页 新闻 会员 周边

mongoTemplate聚合查询时,match,group,sort报错

0
悬赏园豆:5 [已关闭问题] 关闭于 2015-01-22 17:48

Aggregation agg=new Aggregation( match(Criteria.where("_id.time").gte(date1).lt(date2)), group("_id").count("value."+val).as("totals"),

sort(Sort.DEFAULT_DIRECTION,"_id") );

问题补充:

bichen的主页 bichen | 初学一级 | 园豆:190
提问于:2014-11-24 13:25
< >
分享
所有回答(1)
0

怎么解决的啊。。是不是版本的原因啊?

srhlwdamon | 园豆:204 (菜鸟二级) | 2015-12-02 17:58

导入

import static org.springframework.data.mongodb.core.aggregation.Aggregation.group;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.match;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.project;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.sort;

支持(1) 反对(0) bichen | 园豆:190 (初学一级) | 2015-12-02 18:00

@bichen: 嗯嗯 对的  后来解决了  谢谢

支持(0) 反对(0) srhlwdamon | 园豆:204 (菜鸟二级) | 2016-01-13 13:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册