LookupOperation lookup = LookupOperation.newLookup()
.from(SolitaireConstant.START_SOLITAIRE_COLLECTION)
.localField("startSolitaireId")
.foreignField("_id")
.as("startVO");
Criteria criteria = new Criteria();
criteria.and("userId").is(userId);
criteria.and("startVO.status").ne(StatusEnum.DELETED);
Aggregation aggregation = Aggregation.newAggregation(
lookup,
Aggregation.match(criteria),
Aggregation.group("startSolitaireId")
.first("startSolitaireId").as("startSolitaireId")
.first("userId").as("userId")
.first("interact").as("interact")
.first("createTime").as("createTime")
.first("startVO").as("startVO"),
Aggregation.sort(Sort.Direction.DESC,"createTime"),
Aggregation.skip((long) page.getCurrent() * page.getSize()),
Aggregation.limit(page.getSize()));
AggregationResults<MySolitaireVO> aggregate = mongoTemplate.aggregate(aggregation, SolitaireConstant.MY_SOLITAIRE_COLLECTION, MySolitaireVO.class);
List<MySolitaireVO> mappedResults = aggregate.getMappedResults();
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由半码博客整理,本文链接:https://www.bmabk.com/index.php/post/99530.html
赞 (1)
有时候,不是因为你没有能力,也不是因为你缺少勇气,只是因为你付出的努力还太少,所以,成功便不会走向你。而你所需要做的,就是坚定你的梦想,你的目标,你的未来,然后以不达目的誓不罢休的那股劲,去付出你的努力,成功就会慢慢向你靠近。
导读:本篇文章讲解 CSS颜色操作案例Demo【彩色标记笔】,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文
2023年5月26日
004
有时候,不是因为你没有能力,也不是因为你缺少勇气,只是因为你付出的努力还太少,所以,成功便不会走向你。而你所需要做的,就是坚定你的梦想,你的目标,你的未来,然后以不达目的誓不罢休的那股劲,去付出你的努力,成功就会慢慢向你靠近。
导读:本篇文章讲解 【Java进阶篇】第一章 面向对象(上篇),希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文
2023年5月29日
001