Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created September 20, 2013 14:26
Show Gist options
  • Save danielwertheim/6638412 to your computer and use it in GitHub Desktop.
Save danielwertheim/6638412 to your computer and use it in GitHub Desktop.
function(doc) {
if (doc.Type == "A") {
emit([doc.Week, doc.Day, 0]);
}
if (doc.Type == "B") {
emit([doc.Week, doc.Day, 1], doc.Class);
}
}
Query e.g:
http://localhost:5984/samples/_design/foo/_view/test?startkey=[%22A%22,%20%22Mon%22]&endkey=[%22A%22,%20%22Mon%22,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment