I’m storing my data in a schema like this
I wonder how i can create a query in mongoose to get count of created user in the last 7 days where I expect my output to be like this
{
day1: 4,
day2: 4,
day3: 9,
day4: 12,
day5: 7,
day6: 0,
day7: 10
}
sorry for my bad english
2
Answers
This will give you count for users created in last seven days. Dynamic date you can generate in your express backend.
Hello I used mongo aggregate to group the data you need daily like this: