使用 Restheart 的聚合方法

Aggregate method using Restheart

我在 MongoDB 上有一个远程数据库,我想执行一个聚合方法来对条目进行分组 w.r.t。某个领域使用restheart。我的查询如下所示

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

此查询 returns 我的数据库中的唯一用户列表,但我不确定如何使用 restheart 实现它。甚至可以这样做吗?

我来自 restheart.org 团队...

已经在 github https://github.com/SoftInstigate/restheart/issues/55

上提出了类似的问题

我把答案贴在这里:

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

as a workaround you can implement a custom application handler: documentation at https://softinstigate.atlassian.net/wiki/x/IoCw

RESTHeart 版本 1.1 已发布,现在可以管理 aggregation operations:支持 聚合管道map 缩减函数

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.

请告诉我们您的feedback