... | ... | @@ -59,3 +59,85 @@ WHERE events.type_s = 'PushEvent' AND payload.size_i > 2 |
|
|
GROUP BY repo.name_s
|
|
|
ORDER BY avg DESC;
|
|
|
```
|
|
|
|
|
|
## MongoDB
|
|
|
|
|
|
### Stampede-GithubQuery-MongoDB-A
|
|
|
```
|
|
|
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 } }
|
|
|
);
|
|
|
```
|
|
|
### Stampede-GithubQuery-MongoDB-B
|
|
|
```
|
|
|
db.events.aggregate(
|
|
|
[
|
|
|
{ $group: { _id: "$type", total: { $sum: 1 } } },
|
|
|
{ $sort: { total: 1 } }
|
|
|
],
|
|
|
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
|
|
|
);
|
|
|
```
|
|
|
### Stampede-GithubQuery-MongoDB-C
|
|
|
```
|
|
|
db.events.aggregate(
|
|
|
[
|
|
|
{ $group: { _id: "$type", total: { $sum: 1 } } },
|
|
|
{ $sort: { total: -1 } }
|
|
|
],
|
|
|
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
|
|
|
);
|
|
|
```
|
|
|
### Stampede-GithubQuery-MongoDB-D
|
|
|
```
|
|
|
db.events.aggregate(
|
|
|
[
|
|
|
{ $match: { "payload.action": { $exists: true } } },
|
|
|
{ $group: { _id: "$payload.action", total: { $sum: 1 } } },
|
|
|
{ $sort: { total: 1 } }
|
|
|
],
|
|
|
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
|
|
|
);
|
|
|
```
|
|
|
### Stampede-GithubQuery-MongoDB-E
|
|
|
```
|
|
|
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 } }
|
|
|
);
|
|
|
```
|
|
|
### Stampede-GithubQuery-MongoDB-F
|
|
|
```
|
|
|
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 } }
|
|
|
);
|
|
|
``` |
|
|
\ No newline at end of file |