Answers for "mongodb group by year and month"

1

mongodb group by date

db.getCollection('supportIssuesChat').aggregate([
{
        $group : {
           _id :{ $dateToString: { format: "%Y-%m-%d", date: "$createdAt"} },
           list: { $push: "$$ROOT" },
           count: { $sum: 1 }
        }
}
])
Posted by: Guest on April-24-2021

Code answers related to "mongodb group by year and month"

Browse Popular Code Answers by Language