Skip to content

Instantly share code, notes, and snippets.

@whoisstan
Created July 19, 2017 08:12
Show Gist options
  • Save whoisstan/ba896ca69945549dea18e8bfdfd12296 to your computer and use it in GitHub Desktop.
Save whoisstan/ba896ca69945549dea18e8bfdfd12296 to your computer and use it in GitHub Desktop.
[{
"$match": {
"createdAt": {
$gte:new Date(1479189560111)
}
}
}, {
"$group": {
"_id": {
"year": { "$year": "$createdAt" },
"dayOfYear": { "$dayOfYear": "$createdAt" }
},
"count": {
"$sum": 1
}
}
}, {
"$sort": {
"_id": 1
}
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment