| Method | GET /db/_design/design-doc | |
| Request | None | |
| Response | JSON of the existing design document | |
| Admin Privileges Required | no | |
| Query Arguments | Argument | rev |
| Description | Specify the revision to return | |
| Optional | yes | |
| Type | string | |
| Argument | revs | |
| Description | Return a list of the revisions for the document | |
| Optional | yes | |
| Type | boolean | |
| Supported Values | ||
true | Includes the revisions | |
| Argument | revs_info | |
| Description | Return a list of detailed revision information for the document | |
| Optional | yes | |
| Type | boolean | |
| Supported Values | ||
true | Includes the revisions | |
Returns the specified design document,
design-doc from the specified
db. For example, to retrieve the design
document recipes you would send the following
request:
GET http://couchdb:5984/recipes/_design/recipes Content-Type: application/json
The returned string will be the JSON of the design document:
{
"_id" : "_design/recipes",
"_rev" : "5-39f56a392b86bbee57e2138921346406"
"language" : "javascript",
"views" : {
"by_recipe" : {
"map" : "function(doc) { if (doc.title != null) emit(doc.title, doc) }"
},
},
}
A list of the revisions can be obtained by using the
revs query argument, or an extended list of
revisions using the revs_info query argument.
This operates in the same way as for other documents. Fur further
examples, see
Section 6.2, “GET /db/doc”.