Answers for "mongodb aggregation group by date range"

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 aggregation group by date range"

Browse Popular Code Answers by Language