简体   繁体   English

使用Restheart的汇总方法

[英]Aggregate method using Restheart

I have a remote database on MongoDB and i want to execute an aggregate method for grouping entries wrt a certain field using restheart. 我在MongoDB上有一个远程数据库,我想执行一个聚合方法来使用Restheart对某些字段的条目进行分组。 My query looks like this 我的查询看起来像这样

 db.musa.aggregate([{$group:{_id:"$username"}}])

this query returns a list of unique users in my database but i am not sure how to implement it using restheart. 该查询返回数据库中唯一用户的列表,但我不确定如何使用restheart来实现。 Is it even possible to do so? 甚至有可能这样做吗?

I'm from the restheart.org team... 我来自restheart.org团队...

a similar question has been already asked on github https://github.com/SoftInstigate/restheart/issues/55 在github https://github.com/SoftInstigate/restheart/issues/55上已经问过类似的问题

I'm pasting here the answer: 我在这里粘贴答案:

currently aggregate queries are not supported. 当前不支持聚合查询。

note that this is in the roadmap and planned for next version 请注意,这已在路线图中,并计划用于下一个版本

jira task 41: https://softinstigate.atlassian.net/browse/RH-41 吉拉任务41: https : //softinstigate.atlassian.net/browse/RH-41

as a workaround you can implement a custom application handler: documentation at https://softinstigate.atlassian.net/wiki/x/IoCw 作为解决方法,您可以实现自定义应用程序处理程序: https ://softinstigate.atlassian.net/wiki/x/IoCw上的文档

RESTHeart release 1.1 is out and now can manage aggregation operations : both aggregation pipelines and map reduce functions are supported. RESTHeart版本1.1已经发布,现在可以管理聚合操作聚合管道map reduce功能均受支持。

Aggregations operations process data records and return computed results. 聚合操作处理数据记录并返回计算结果。 Aggregation operations group values from multiple documents together, and can perform a variety of operations on the grouped data to return a single result. 聚合操作将来自多个文档的值分组在一起,并且可以对分组的数据执行各种操作以返回单个结果。

Please let us know your feedback . 请让我们知道您的反馈

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM