My data mongoDB
:
>db.CUSTOMER.find()
{"Name": "A", "CreatedDate": "Wed Jan 29 2014"}
{"Name": "B", "CreatedDate": "Fri Jan 31 2014"}
{"Name": "C", "CreatedDate": "Sat Feb 01 2014"}
{"Name": "D", "CreatedDate": "Sat Feb 01 2014"}
In meteor:
Customer = new Meteor.Collection("CUSTOMER");
I'm trying to group them by date (Mon, Tues, Wed, ...) in meteor collection along with the total of the data. It should be something like this:
{"Date": "Wed Jan 29 2014", "Total" 1}
{"Date": "Fri Jan 31 2014", "Total" 1}
{"Date": "Sat Feb 01 2014", "Total" 2}
In mongoDB, I'd just go with http://docs.mongodb.org/manual/reference/method/db.collection.group/, but apparently, it is impossible in meteor, for it doesn't support findAndModify, upsert, aggregate functions, and map/reduce.
Is there any examples of workaround that I can do to make it works?
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…