meteor - Grouping by property value (and counting?) in MongoDB -
i'm using meteor web project, , need find way group (and count) records in collection 1 of properties. sample record collection ned from:
{ "owner" : "7ynnwsc3e3itcrhcc", "isbn" : "1551110881", "title" : "introduction", "type" : "0", "class" : "adnr1234", "condition" : "0", "active" : false, "createdat" : isodate("2014-08-18t15:38:30.012z"), "tradefor" : { "isbn" : "7463849506", "title" : "intro 2" }, "_id" : "rfzvedlkyxt5emq7s" }
i know need figure out way do...i guess it's called aggregation? anyway...the property i'm needing use "class". need way go through whole collection , let me output each class (adnr1234) number of records have each used class value.
i hope didn't ask question poorly, i'm sort of new meteor, , seems sort of weird problem try solve.
officially aggregation not supported.
however people started solve issue:
http://atmospherejs.com/package/mongodb-aggregation?q=aggregation https://github.com/meteor/meteor/pull/644
Comments
Post a Comment