Skip to content

Instantly share code, notes, and snippets.

@tgrall
Created February 13, 2013 12:06
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 tgrall/4944154 to your computer and use it in GitHub Desktop.
Save tgrall/4944154 to your computer and use it in GitHub Desktop.
function(doc, meta) {
switch(doc.type) {
case "brewery":
emit([meta.id, 0, doc.name]);
break;
case "beer":
if (doc.name && doc.brewery_id) {
emit([doc.brewery_id, 1, doc.name], null);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment