Created
September 8, 2015 02:58
-
-
Save anapaulagomes/7083e1d292e6c9d47308 to your computer and use it in GitHub Desktop.
Agrupa de acordo com parâmetros de busca e soma de acordo com um parâmetro da coleção - MongoDB
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.checkins.aggregate([ | |
{ $match : | |
{ | |
nome: 'AKB48劇場 (AKB48 Theater)', | |
classe: 'turista' } | |
}, | |
{$group: | |
{ | |
_id: '$horario', | |
checkins: {$sum: 1}} | |
}, | |
{$sort: {checkins:-1} } | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment