Skip to content

Instantly share code, notes, and snippets.

View ahachete's full-sized avatar

Álvaro Hernández Tortosa ahachete

View GitHub Profile
db.events.aggregate(
[
{ $match: { "payload.action": { $exists: true } } },
{ $group: { _id: "$payload.action", total: { $sum: 1 } } },
{ $sort: { total: 1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
db.events.aggregate(
[
{ $group: { _id: "$type", total: { $sum: 1 } } },
{ $sort: { total: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
db.events.aggregate(
[
{ $group: { _id: "$type", total: { $sum: 1 } } },
{ $sort: { total: 1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
db.events.aggregate(
[
{ $match: {
$and: [ { type: "IssuesEvent"} , { "payload.action" : "opened" } ] }
},
{ $group: { _id: "$repo.name", total: { $sum: 1 } } },
{ $sort: { total: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);