Method | POST /db/_all_docs | |
Request | JSON of the document IDs you want included | |
Response | JSON of the returned view | |
Admin Privileges Required | no |
The POST
to _all_docs
allows
to specify multiple keys to be selected from the database. This
enables you to request multiple documents in a single request, in
place of multiple
Section 6.2, “GET /db/doc
” requests.
The request body should contain a list of the keys to be returned
as an array to a keys
object. For example:
POST http://couchdb:5984/recipes/_all_docs User-Agent: MyApp/0.1 libwww-perl/5.837 { "keys" : [ "Zingylemontart", "Yogurtraita" ] }
The return JSON is the all documents structure, but with only the selected keys in the output:
{ "total_rows" : 2666, "rows" : [ { "value" : { "rev" : "1-a3544d296de19e6f5b932ea77d886942" }, "id" : "Zingylemontart", "key" : "Zingylemontart" }, { "value" : { "rev" : "1-91635098bfe7d40197a1b98d7ee085fc" }, "id" : "Yogurtraita", "key" : "Yogurtraita" } ], "offset" : 0 }