Created
June 12, 2015 13:35
-
-
Save cjlyth/2f5b9715bd9b370acef4 to your computer and use it in GitHub Desktop.
mongo for work
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.zz_an02_cache.find({an02cacheKey:"8-70273186-1465091679-1434033220871"},{outletId:-1}) | |
db.zz_an02_cache.aggregate( [ | |
{ $match: { an02cacheKey: "1884586746-2-96337202-1434032093666" } } | |
, { $group: { _id: "$outletId" } } | |
] ); | |
{ $group: { _id: "$state", totalPop: { $sum: "$pop" } } }, | |
db.zz_an02_cache.aggregate( [ | |
{ $match: { an02cacheKey: "1884586746-2-96337202-1434032093666" } } | |
, { $group: { _id: "$outletId" } } | |
, { $group: { _id: 1, count: { $sum: 1 } } } | |
] ); | |
db.zz_an02_cache.distinct( "outletId",{ an02cacheKey: "1884586746-2-96337202-1434033372067" }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment