I wanna run multiple queries to get the count on a MongoDB collection. Like, I wanna run a query to find out pending status users and completed status users. Something like this, is there a way to write these two conditions in a query/aggregation and get the separate results in MongoDB?
My Requirement is,
I need to get the count of the user of status pending, completed and open for Today, Yesterday, last week and last Month.
I need different status count like this,
{
"today": {
"pending": 10,
"completed": 13,
"open": 5
},
"yesterday": {
"pending": 10,
"completed": 13,
"open": 5
},
"lastWeek": {
"pending": 10,
"completed": 13,
"open": 5
},
"lastMonth": {
"pending": 10,
"completed": 13,
"open": 5
}
}