Created
May 18, 2016 12:26
-
-
Save zbitname/abeee56e142938d8a5ddea2e16ac848b to your computer and use it in GitHub Desktop.
How many times will be called reduce function for collection with 1 object?
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.for_map_reduce.insert({name: 'Jane'}) | |
db.for_map_reduce.mapReduce( | |
function() { | |
emit(null, this.name); | |
}, | |
function(key, names) { | |
return names.length; | |
}, | |
{ | |
out: { | |
inline: 1 | |
}, | |
query: {}, | |
finalize: function(key, value) { | |
return value; | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment