Skip to content

Instantly share code, notes, and snippets.

@ahachete
Created November 30, 2016 11:24
Show Gist options
  • Save ahachete/f762cf3c48bfe6f8e5a126d2d5f9f2f4 to your computer and use it in GitHub Desktop.
Save ahachete/f762cf3c48bfe6f8e5a126d2d5f9f2f4 to your computer and use it in GitHub Desktop.
db.events.aggregate(
[
{ $match: { "type": "PushEvent", "payload.size": { $gt : 2 } } },
{ $group: { _id: "$repo.name", avg: { $avg: "$payload.size" } } },
{ $sort: { avg: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment