使用OPA MongoDB高级API的基本GROUP BY语句 [英] Basic GROUP BY statement using OPA MongoDB high level API

查看:139
本文介绍了使用OPA MongoDB高级API的基本GROUP BY语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单:我想使用OPAlang高级数据库API对MongoDB执行GROUP BY like语句.但我认为这是不可能的(?)

My question is quite simple: I'd like to perform a GROUP BY like statement with MongoDB using the OPAlang high level database API. But I don't think that is possible (?)

如果我确实想执行mongodb $ group操作,是否一定需要使用低级API(使用stdlib.apis.mongo吗?)

If I do want to perform a mongodb $group operation, do I necessarily need to use the low-level API (using stdlib.apis.mongo ?)

最后,我可以同时使用低级和高级API与我的MongoDB通信吗?

Finally, can I use both low-level and high-level APIs to communicate with my MongoDB ?

谢谢.

推荐答案

恐怕考虑到最新发布的Opa编译器代码,不支持聚合:(请参见

I am afraid that, taking into account latest published Opa compiler code, no aggregation is supported :( See the thread in Opa forum. Also note the comment of Quentin about the using both low- and high-level API-s:

您可以同时使用此[低级]库和内置的[高级]库,[...]"

"You can use this [low level] library and built-in [hight level] library together, [...]"

此线程中,查看来自MLstate的人员的自动增量实施建议.请注意高级DB字段/next_id的定义和初始化以及低级的读取和递增操作.

See the auto-increment implementation advices by the guys from the MLstate in this thread. Note the high level DB field /next_id definition and initialization with low level read and increment.

这篇关于使用OPA MongoDB高级API的基本GROUP BY语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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