Spring Data MongoDB-聚合框架集成 [英] Spring data mongodb - aggregation framework integration

查看:77
本文介绍了Spring Data MongoDB-聚合框架集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在应用程序中使用MongoDB数据库,并且为了进行数据访问,我选择了Spring Data for MongoDB.

I started to use MongoDB database in my application and for data access I have chosen Spring Data for MongoDB.

我浏览了API参考和文档,可以看到存在map-reduce集成,但是聚合框架又如何呢?我可以看到它支持分组操作,这表明它支持$group运算符: http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/,但是其他运算符呢,现在不支持吗?

I skimmed API reference and documentation and I can see that there is map-reduce integration but what about aggregation framework? I can see that it supports group by operation, which would indicate that it supports $group operator judging from this: http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/, but what about other operators, are that not supported for now?

我之所以问这个问题,是因为我想知道与MongoDB Sping Data提供的集成是什么,所以我知道可以期待什么.

I am asking this question because I wanted to know what kind of integration with MongoDB Sping Data provides so I know what to expect, so to speak.

推荐答案

Spring Data MongoOperations.group()方法映射到db.collection.group() MongoDB命令,而不是$group聚合函数.当前,Spring Data MongoDB中不支持聚合框架.您已经提到,虽然

The Spring Data MongoOperations.group() method is mapped to db.collection.group() MongoDB command and not the $group aggregation function. Currently there is no support in Spring Data MongoDB for aggregation framework. Map reduce, as you have mentioned, is supported though

这篇关于Spring Data MongoDB-聚合框架集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆