MongoDB aggregate within daily grouping [duplicate]
In Mongo 2.8 RC2 there is a new data aggregation operator: $dateToString which can be used to group by a day and simply have a “YYYY-MM-DD” in the result: Example from the documentation: db.sales.aggregate( [ { $project: { yearMonthDay: { $dateToString: { format: “%Y-%m-%d”, date: “$date” } }, time: { $dateToString: { format: “%H:%M:%S:%L”, date: … Read more