Skip to content

Instantly share code, notes, and snippets.

@ntanya
Created June 26, 2012 20:07
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 ntanya/2998550 to your computer and use it in GitHub Desktop.
Save ntanya/2998550 to your computer and use it in GitHub Desktop.
Map Reduce
var map = function(){
emit(this.tag, {tag_date: this.tag_date, count:this.count});
}
var reduce = function(key, values){
var obj = {value: []};
for(var i in values){
obj.value.push({tag_date:values[i].tag_date, count:values[i].count});
}
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment