![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mongo
lvk0804
这个作者很懒,什么都没留下…
展开
-
java mongo 复杂函数计算
group、sum 函数 channel_code_parameter, class_id 分组,并且 取出channelCodeGroup、channelCodeTitle、className、firstNum sum计算等 Aggregation.group("channel_code_parameter", "class_id").max("new_department").as("channelCodeGroup").max("channel_code_title").as("channelCode原创 2020-10-14 15:00:34 · 230 阅读 · 0 评论 -
mongoTemplate 聚合分组统计复杂条件分组sum\去重\$project\$cond\$addToSet
sql 原型:在这里插入代码片db.order.aggregate({ $match: { “course_mode”: { $gt: 2 }, “is_new”: 1 } }, { KaTeX parse error: Expected '}', got 'EOF' at end of input: … "part_mode": "part_mode" }, “student_total”: {...原创 2019-12-14 15:06:14 · 3686 阅读 · 0 评论 -
mongoTemplate 聚合分组统计,aggregate分页
/** *mongoTemplate 聚合分组统计返回分组列表 */ public Page<Log> groupStatistics(String compCampId, Long productId, Integer page, Integer size) { if (page<1){page=1;} Integer star...原创 2019-08-20 11:46:22 · 7597 阅读 · 3 评论 -
mongoTemplate.aggregate聚合 in查询条件匹配,复杂or 查询
Criteria.where("source").ne(null).exists(true).and("operation_name").in(patterns); /**source 字段必须存在,且不为空, 匹配in 条件**/原创 2019-08-20 11:53:33 · 4215 阅读 · 0 评论