Last active
June 25, 2016 12:18
-
-
Save adispen/c74a8bf64b66eea6a82131a11ccf979f to your computer and use it in GitHub Desktop.
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['streams'].aggregate([ | |
{"$unwind":"$stats"}, | |
{"$match":{"$and":[{"stats.rank":{"$lt":10}}, {"stats.time":{"$gt":"2016.06.25.07.00.42"}}]}}, | |
{"$group":{"_id":{"stats":"$stats","name":"$name"}}}, | |
{"$project":{"stats":"$_id.stats","name":"$_id.name","_id":0,"viewers":"$_id.stats.viewers","time":"$_id.stats.time"}}, | |
{"$limit":10000} | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment