8.10. POST /db/_design/design-doc/_view/view-name

8.10.1. Multi-document Fetching
MethodPOST /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 Requiredno
Query ArgumentsArgumentdescending
 Description Return the documents in descending by key order
 Optionalyes
 Typeboolean
 Defaultfalse
   
 Argumentendkey
 Description Stop returning records when the specified key is reached
 Optionalyes
 Typestring
   
 Argumentendkey_docid
 Description Stop returning records when the specified document ID is reached
 Optionalyes
 Typestring
   
 Argumentgroup
 Description Group the results using the reduce function to a group or single row
 Optionalyes
 Typeboolean
 Defaultfalse
   
 Argumentgroup_level
 Description Specify the group level to be used
 Optionalyes
 Typenumeric
   
 Argumentinclude_docs
 Description Include the full content of the documents in the return
 Optionalyes
 Typeboolean
 Defaultfalse
   
 Argumentinclusive_end
 Description Specifies whether the specified end key should be included in the result
 Optionalyes
 Typeboolean
 Defaulttrue
   
 Argumentkey
 Description Return only documents that match the specified key
 Optionalyes
 Typestring
   
 Argumentlimit
 Description Limit the number of the returned documents to the specified number
 Optionalyes
 Typenumeric
   
 Argumentreduce
 Description Use the reduction function
 Optionalyes
 Typeboolean
 Defaulttrue
   
 Argumentskip
 Description Skip this number of records before starting to return the results
 Optionalyes
 Typenumeric
 Default0
   
 Argumentstale
 Description Allow the results from a stale view to be used
 Optionalyes
 Typestring
 Default 
 Supported Values 
 okAllow stale views
   
 Argumentstartkey
 Description Return records starting with the specified key
 Optionalyes
 Typestring
   
 Argumentstartkey_docid
 Description Return records starting with the specified document ID
 Optionalyes
 Typestring
   
 Argumentupdate_seq
 Description Include the update sequence in the generated results
 Optionalyes
 Typeboolean
 Defaultfalse

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
}