I understand that the 'mini-mongo' packaged with meteor up till 0.6 had a few limitations around aggregation, but hoping the story is a bit easier with the release of 0.6.
What I'm trying to work around is the lack of 'aggregation' in mini-mongo.
I have a mongodb with records like this
db.account_records.findOne()
{
"type" : "initial_balance",
"amt" : 10,
"account_id" : "95CPB9Be8NX3TGSpi",
"_id" : "L9D7Agt4gW2Ht4NTA"
}
and I want to subscribe (at client) to a query like the following..
db.events.aggregate( [ { $group: {_id:"$account_id", balance: { $sum: "$amt"}}}]);
.. which gives (when run using "real" mongodb from terminal "mongo meteor" style)..
{
"result" : [
{
"_id" : "Dn5Eouw8K4RrP9SGw",
"balance" : 169.99922000000308
},
{
"_id" : "Bawopno2QGs8guMWy",
"balance" : 1
},
{
"_id" : "95CPB9Be8NX3TGSpi",
"balance" : 5
}
],
"ok" : 1
}
It seems unlikely to me that it will ever be possible (or desirable) to perform complex aggregate clauses client side so i can see the reason we have mini-mongo. But I was hoping that with the ability to install standard npm modules in the new version of meteor it might be a bit easier to create a query that I can publish from 'real' mongo and subscribe to in mini-mongo?
--
PS I found this already but all those double underscores are making me nervous I'd be attempting something complicated... https://github.com/meteor/meteor/pull/644