Created
May 12, 2014 14:29
-
-
Save Koronen/21d05315c3714346ca6c to your computer and use it in GitHub Desktop.
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
// http://docs.mongodb.org/manual/core/map-reduce/ | |
// $ tail -f /var/log/mongodb/mongodb.log | |
var map = function(){ | |
print("map"); | |
emit(1, 2); | |
}; | |
var reduce = function(key, values){ | |
print("reduce"); | |
return Array.sum(values); | |
}; | |
db.submissions.mapReduce(map, reduce, { out: 'foobar'} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment