Created
August 6, 2014 06:21
-
-
Save lxneng/0b79d373cda4bdfe3dcc to your computer and use it in GitHub Desktop.
mongodb distinct multiple fields
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
collection = db.getCollection('foo') | |
result = collection.aggregate( | |
[ | |
{"$group": { "_id": { fa: "$fa", fb: "$fb" } } } | |
] | |
); | |
printjson(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment