Skip to content

Instantly share code, notes, and snippets.

@fgarcia
Created January 25, 2014 09:50
Show Gist options
  • Select an option

  • Save fgarcia/8614169 to your computer and use it in GitHub Desktop.

Select an option

Save fgarcia/8614169 to your computer and use it in GitHub Desktop.
{
"_id" => "_design/Foo",
"language" => "javascript",
"views" => {
"by_name" => {
"map" => "function(doc) {\n if ((doc['type'] == 'Foo') && (doc['name'] != null)) {\n emit(doc['name'], null);\n }\n}\n"
},
"by_tag" => {
"map" => "function(doc) {\n if ((doc['type'] == 'Foo') && (doc['tag'] != null)) {\n emit(doc['tag'], null);\n }\n}\n"
},
"by_value" => {
"map" => "function(doc) {\n if ((doc['type'] == 'Foo') && (doc['value'] != null)) {\n emit(doc['value'], null);\n }\n}\n"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment