Created
September 11, 2014 06:24
-
-
Save pvoznenko/5f01e2be2fba11d8a60f to your computer and use it in GitHub Desktop.
hw5.4
This file contains hidden or 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.zips.aggregate([ | |
{$project: {first_char: {$substr : ["$city",0,1]}, pop:1}}, | |
{$match:{"first_char":{"$regex": "[0-9]"}}}, | |
{$group:{"_id":null, sum: {"$sum": "$pop"}}} | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment