Skip to content

Instantly share code, notes, and snippets.

@manchicken
Last active December 21, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manchicken/6331238 to your computer and use it in GitHub Desktop.
Save manchicken/6331238 to your computer and use it in GitHub Desktop.
db.foo.find().forEach(printjson);
db.foo.mapReduce(
function () {
emit (this["First Name"].toLowerCase().split('')[0], 1);
},
function (key,value) {
return Array.sum(value);
},
{
out : "foo_out"
}
);
db.foo_out.find().forEach(printjson);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment