This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.events.aggregate( | |
[ | |
{ $group: { _id: "$type", total: { $sum: 1 } } }, | |
{ $sort: { total: 1 } } | |
], | |
{ allowDiskUse: true, cursor: { batchSize: 100000000 } } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.events.aggregate( | |
[ | |
{ $group: { _id: "$type", total: { $sum: 1 } } }, | |
{ $sort: { total: -1 } } | |
], | |
{ allowDiskUse: true, cursor: { batchSize: 100000000 } } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.events.aggregate( | |
[ | |
{ $match: { "payload.action": { $exists: true } } }, | |
{ $group: { _id: "$payload.action", total: { $sum: 1 } } }, | |
{ $sort: { total: 1 } } | |
], | |
{ allowDiskUse: true, cursor: { batchSize: 100000000 } } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.events.aggregate( | |
[ | |
{ $match: { "type": "PushEvent" } }, | |
{ $project: { "repo.name": 1, "actor.login": 1 } }, | |
{ $group: | |
{ | |
_id: "$repo.name", | |
actor: { $first: "$actor.login"}, | |
count: { $sum: 1 } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT repo.name_s, count(*) | |
FROM github.events AS events | |
INNER JOIN github.events_repo AS repo ON (events.did = repo.did) | |
INNER JOIN github.events_payload AS payload ON (events.did=payload.did) | |
WHERE events.type_s = 'IssuesEvent' AND payload.action_s = 'opened' | |
GROUP BY repo.name_s | |
ORDER BY count desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT type_s, count(*) | |
FROM github.events | |
GROUP BY type_s | |
ORDER BY count desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT events.type_s, count(*) | |
FROM github.events AS events | |
JOIN github.events_actor AS actor ON (events.did = actor.did) | |
GROUP BY type_s | |
ORDER BY count DESC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT action_s, count(*) | |
FROM github.events_payload | |
WHERE action_s IS NOT NULL | |
GROUP BY action_s | |
ORDER BY count DESC; |
OlderNewer