Skip to content

Instantly share code, notes, and snippets.

@anandology
Created March 20, 2009 11:14
Show Gist options
  • Save anandology/82322 to your computer and use it in GitHub Desktop.
Save anandology/82322 to your computer and use it in GitHub Desktop.
couchdb view for /type/edition
{
"_rev": "1-262566171",
"_id": "_design/type_edition",
"language": "javascript",
"views": {
"by_title": {
"map": "function(doc) { if (doc.type.key == '/type/edition' && doc.title) emit(doc.title, doc.key);}"
},
"by_isbn_10": {
"map": "function(doc) { if (doc.type.key == '/type/edition' && doc.isbn_10) for (var i in doc.isbn_10) emit(doc.isbn_10[i], doc.key);}"
},
"by_authors": {
"map": "function(doc) { if (doc.type.key == '/type/edition' && doc.authors) for (var i in doc.authors) emit(doc.authors[i].key, doc.key);}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment