Mongodb get information to make some stats -
i need information mongodb database, cant realize request actual skill...
can me making ?
i have : - sum of object attribute {isdone : true} - filter 2 dates - group month concerned
thanks advance
all need aggregation framework.
db.coll_name.aggregate([ {$match: {date_field: {$gt: new date("...")}, date_field: {$lt: new date("...")}}, // date range {$project: {isdone: "$isdone", year: {$year: "$year"}, month: {$month: "$month"}}}, // extract year/month , isdone {$group: {_id: {year: "$year", month: "$month"}, count: {$sum: 1}} ]);
Comments
Post a Comment