Published
- 1 min read
mongodb group by date
The solution for this is noted below
mongodb group by date
Solution
db.getCollection('supportIssuesChat').aggregate([
{
$group : {
_id :{ $dateToString: { format: "%Y-%m-%d", date: "$createdAt"} },
list: { $push: "$$ROOT" },
count: { $sum: 1 }
}
}
])
Try other methods by searching on the site. That is if this doesn’t work