I'm using the latest version of mongoose. My model looks like this:
{
id:'',
name:'',
text:'',
createdAt:Date
}
Now I'd like to create a query that is giving me a [minute] rollup.
For instance let's say I have 3 entries in my collection.
a) createdAt: 12:50
b) createdAt: 12:50
c) createdAt: 12:51
If I want to have minute rollups, I would want to have a result like this:
{
12:50: 2,
12:51: 1
}
I've tried a few different aggregations, but none of them really worked.