Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:36
Show Gist options
  • Save craigw/150800 to your computer and use it in GitHub Desktop.
Save craigw/150800 to your computer and use it in GitHub Desktop.
{
"tags": {
"map": "function(doc) { if(doc.type == 'article') { for(var i in doc.tags) { emit(doc.tags[i], 1); }}}",
"reduce": "function(tag, counts) { var sum = 0; for(var i = 0; i < counts.length; i++) { sum += counts[i]; }; return sum; }"
}
// other views omitted for brevity
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment