| Method | POST /db/_design/design-doc/_view/view-name | |
| Request | List of keys to be returned from specified view | |
| Response | JSON of the documents returned by the view | |
| Admin Privileges Required | no | |
| Query Arguments | Argument | descending |
| Description | Return the documents in descending by key order | |
| Optional | yes | |
| Type | boolean | |
| Default | false | |
| Argument | endkey | |
| Description | Stop returning records when the specified key is reached | |
| Optional | yes | |
| Type | string | |
| Argument | endkey_docid | |
| Description | Stop returning records when the specified document ID is reached | |
| Optional | yes | |
| Type | string | |
| Argument | group | |
| Description | Group the results using the reduce function to a group or single row | |
| Optional | yes | |
| Type | boolean | |
| Default | false | |
| Argument | group_level | |
| Description | Specify the group level to be used | |
| Optional | yes | |
| Type | numeric | |
| Argument | include_docs | |
| Description | Include the full content of the documents in the return | |
| Optional | yes | |
| Type | boolean | |
| Default | false | |
| Argument | inclusive_end | |
| Description | Specifies whether the specified end key should be included in the result | |
| Optional | yes | |
| Type | boolean | |
| Default | true | |
| Argument | key | |
| Description | Return only documents that match the specified key | |
| Optional | yes | |
| Type | string | |
| Argument | limit | |
| Description | Limit the number of the returned documents to the specified number | |
| Optional | yes | |
| Type | numeric | |
| Argument | reduce | |
| Description | Use the reduction function | |
| Optional | yes | |
| Type | boolean | |
| Default | true | |
| Argument | skip | |
| Description | Skip this number of records before starting to return the results | |
| Optional | yes | |
| Type | numeric | |
| Default | 0 | |
| Argument | stale | |
| Description | Allow the results from a stale view to be used | |
| Optional | yes | |
| Type | string | |
| Default | ||
| Supported Values | ||
ok | Allow stale views | |
| Argument | startkey | |
| Description | Return records starting with the specified key | |
| Optional | yes | |
| Type | string | |
| Argument | startkey_docid | |
| Description | Return records starting with the specified document ID | |
| Optional | yes | |
| Type | string | |
| Argument | update_seq | |
| Description | Include the update sequence in the generated results | |
| Optional | yes | |
| Type | boolean | |
| Default | false | |
Executes the specified view-name from the
specified design-doc design document. Unlike
the GET method for accessing views, the
POST method supports the specification of
explicit keys to be retrieved from the view results. The remainder
of the POST view functionality is identical to
the
Section 8.9, “GET /db/_design/design-doc/_view/view-name”
fun
For example, the request below will return all the recipes where the key for the view matches either “claret” or “clear apple cider” :
POST http://couchdb:5984/recipes/_design/recipes/_view/by_ingredient
Content-Type: application/json
{
"keys" : [
"claret",
"clear apple juice"
]
}The returned view data contains the standard view information, but only where the keys match.
{
"total_rows" : 26484,
"rows" : [
{
"value" : [
"Scotch collops"
],
"id" : "Scotchcollops",
"key" : "claret"
},
{
"value" : [
"Stand pie"
],
"id" : "Standpie",
"key" : "clear apple juice"
}
],
"offset" : 6324
}