Skip to content

Instantly share code, notes, and snippets.

@alkampfergit
Created December 15, 2014 16:46
Show Gist options
  • Save alkampfergit/bcb8364c67ba7703152a to your computer and use it in GitHub Desktop.
Save alkampfergit/bcb8364c67ba7703152a to your computer and use it in GitHub Desktop.
NEventStore mongo provider get count of events by type
db.Commits.aggregate([
{$sort: {_id:1}},
{$unwind : "$Events"},
{$project : { event : '$Events.Payload.Body._t'}},
{$group : {
'_id' : '$event',
'count' : {$sum : 1}}
}
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment