wohali commented on a change in pull request #263: Add the POST _bulk_get
endpoint
URL:
https://github.com/apache/couchdb-documentation/pull/263#discussion_r175498710
##########
File path: src/api/database/bulk-api.rst
##########
@@ -456,6 +456,139 @@ Sending multiple queries to a database
The multiple queries are also supported in /db/_local_docs/queries and
/db/_design_docs/queries (similar to /db/_all_docs/queries).
+.. _api/db/bulk_get:
+
+==================
+``/db/_bulk_get``
+==================
+
+.. http:post:: /{db}/_bulk_get
+ :synopsis: Fetches several documents at the given revision
+
+ This method is used by PouchDB and other client to improve the pull
+ replications, by allowing the client to request multiple documents in one
+ request.
+
+ The usual CouchDB API for bulk gets -- a POST to _all_docs with an array of
+ docIDs in the body -- isn't suitable for the replicator because:
+
+ - there's no way to specify which specific revisions are needed (it always
+ returns the default revision),
+ - the response doesn't contain the revision history,
+ - there's no way to specify that only recently changed attachments should
+ be included (a la ``atts_since``),
+ - and attachment bodies can only be encoded inline (base64) not as MIME
+ multipart bodies.
+
+ :param db: Database name
+ :<header Accept: - :mimetype:`application/json`
+ :<header Content-Type: :mimetype:`application/json`
+ :query boolean revs: Give the revisions history
+ :<json array docs: List of document objects, with ``id``, and optionnaly
+ ``rev`` and ``atts_since``
+ :>header Content-Type: - :mimetype:`application/json`
+ :>json object results: the documents, with the additionnal ``_revisions``
+ property that lists the parent revisions if ``revs=true``
+ :code 200: Request completed successfully
Review comment:
Are there other codes it can return? If unsure, check the source code.
Here's one possible error it can return:
https://github.com/apache/couchdb/blob/master/src/chttpd/src/chttpd_db.erl#L475
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services