Skip to content

Instantly share code, notes, and snippets.

@kennon
Created May 10, 2010 10:22
Show Gist options
  • Save kennon/395893 to your computer and use it in GitHub Desktop.
Save kennon/395893 to your computer and use it in GitHub Desktop.
map:
function(doc) {
if (doc.attackers) {
for (var i in doc.attackers) {
if( doc.attackers[i].name ) {
emit(doc.attackers[i].corporation, 1);
}
}
}
}
reduce:
function(keys, values) {
return sum(values);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment