1

I have a remote database on MongoDB and i want to execute an aggregate method for grouping entries w.r.t. a certain field using 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. Is it even possible to do so?

Arsalan Ahmed
  • 383
  • 2
  • 3
  • 14

2 Answers2

2

I'm from the restheart.org team...

a similar question has been already asked on 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

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

Community
  • 1
  • 1
Andrea Di Cesare
  • 1,125
  • 6
  • 11
2

RESTHeart release 1.1 is out and now can manage aggregation operations: both aggregation pipelines and map reduce functions are supported.

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.

mturatti
  • 651
  • 5
  • 10