Is a Mongo-style db.collection.group(...)
query possible in Meteor, yet? I was hoping i could run something like this on the server (coffeescript):
Meteor.publish "top10", ->
Records.group
key: {name:true}
reduce: (obj, agg) -> agg.count++
initial: {count:0}
Actually not yet.
Meteor uses node-mongo-native to do CURD in the server-side, whilst minimongo in the client-side. And Meteor keeps same API in the both side.
The document says -
In this release, Minimongo has some limitations:
...
findAndModify, upsert, aggregate functions, and map/reduce aren't supported.
However, node-mongo-native supports them, so I think Meteor just doesn't expose the related API for us. You can take a look at packages/mongo-livedata/mongo_driver.js, and help yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With