SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

How to get distinct values ( question ) #131

Closed mohamed-ouakil closed 8 years ago

mohamed-ouakil commented 8 years ago

Hi All,

i read the doc and cannot find how to achieve this

i have this on the collection :
{ "type" : "A" "value" : 111 } { "type" : "B" "value" : 111 } { "type" : "A" "value" : 222 }

i can do that on mongo shell : db.collection_test.distinct("type")

it return me : [ "A", "B"]

how to do the same on restheart ? i tried many /get/collection_test?filter parameter but it doesn't works

thanks for your reply

regards

ujibang commented 8 years ago

Hi

You have to create an aggregation. See how to do it in documentation.

mohamed-ouakil commented 8 years ago

Hi ,

thanks a lot :)