Created
July 21, 2015 18:33
-
-
Save anonymous/6254abad506461cd1cb4 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
in mongo shell, the following works: | |
db.getCollection('philly_seer').aggregate([ | |
{ $match: {cause_code: 488}}, | |
{ $group: {_id: "$date", total: {$sum: "$call_attempts"} } }, | |
]) | |
but in ruby, this will not work | |
match = { '$match' => {'cause_code' => 488}} | |
group = { '$group' => {'_id' => {$sum: "$call_attempts"} } } | |
coll.aggregate([match, group]) # returns an empty array. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment