couchdb - Design Documents - couchdb tutorial - futon couch - nosql
_design example
- Design documents contain application logic. Any document in a database that has an _id starting with "_design/" can be used as design document. Usually there is one design document for each application.
{
"_id": "_design/example",
"view": {
"foo": {
"map": "function(doc){...};",
"reduce": "function(keys, values, rereduce){...};"
}
}
}
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy Couchdb tutorial team
- The example above defines a view named foo, which can be requested from the following path, assuming the database is named db:
http://localhost:5984/db/_design/example/_view/foo