Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
db.events.aggregate(
[
{ $match: { "type": "PushEvent" } },
{ $project: { "repo.name": 1, "actor.login": 1 } },
{ $group:
{
_id: "$repo.name",
actor: { $first: "$actor.login"},
count: { $sum: 1 }
}
},
{ $group:
{
_id: "$_id",
count: { $sum: 1 }
}
},
{ $sort: { count: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment