couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fli...@apache.org
Subject [couchdb-documentation] branch master updated: Improvements for bulk get documentation (#379)
Date Mon, 21 Jan 2019 06:31:46 GMT
This is an automated email from the ASF dual-hosted git repository.

flimzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-documentation.git


The following commit(s) were added to refs/heads/master by this push:
     new 760f741  Improvements for bulk get documentation (#379)
760f741 is described below

commit 760f741181dd24af9135722cc0c81721fdfd1e4c
Author: Jonathan Hall <flimzy@flimzy.com>
AuthorDate: Mon Jan 21 07:31:42 2019 +0100

    Improvements for bulk get documentation (#379)
    
    * Update Bulk Get response to be valid
    
    * Spelling corrections
    
    * Add error example to Bulk Get results
    
    * More complete description of BulkGet results
    
    * Document multipart capability of _bulk_get endpoint
---
 src/api/database/bulk-api.rst | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/api/database/bulk-api.rst b/src/api/database/bulk-api.rst
index c7088e1..7729f90 100644
--- a/src/api/database/bulk-api.rst
+++ b/src/api/database/bulk-api.rst
@@ -471,13 +471,19 @@ Sending multiple queries to a database
 
     :param db: Database name
     :<header Accept: - :mimetype:`application/json`
+                     - :mimetype:`multipart/related`
+                     - :mimetype:`multipart/mixed`
     :<header Content-Type: :mimetype:`application/json`
     :query boolean revs: Give the revisions history
-    :<json array docs: List of document objects, with ``id``, and optionnaly
+    :<json array docs: List of document objects, with ``id``, and optionally
       ``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``
+    :>json object results: an array of results for each requested document/rev
+      pair. ``id`` key lists the requested document ID, ``docs`` contains a
+      single-item array of objects, each of which has either an ``error`` key and
+      value describing the error, or ``ok`` key and associated value of the
+      requested document, with the additional ``_revisions`` property that lists
+      the parent revisions if ``revs=true``.
     :code 200: Request completed successfully
     :code 400: The request provided invalid JSON data or invalid query parameter
     :code 401: Read permission required
@@ -506,6 +512,9 @@ Sending multiple queries to a database
                 {
                     "id": "bar",
                 }
+                {
+                    "id": "baz",
+                }
             ]
         }
 
@@ -526,7 +535,7 @@ Sending multiple queries to a database
               "docs": [
                 {
                   "ok": {
-                    "_id": "bbb",
+                    "_id": "foo",
                     "_rev": "4-753875d51501a6b1883a9d62b4d33f91",
                     "value": "this is foo",
                     "_revisions": {
@@ -547,7 +556,7 @@ Sending multiple queries to a database
               "docs": [
                 {
                   "ok": {
-                    "_id": "bbb",
+                    "_id": "foo",
                     "_rev": "1-4a7e4ae49c4366eaed8edeaea8f784ad",
                     "value": "this is the first revision of foo",
                     "_revisions": {
@@ -578,6 +587,19 @@ Sending multiple queries to a database
                   }
                 }
               ]
+            },
+            {
+              "id": "baz",
+              "docs": [
+                {
+                  "error": {
+                    "id": "baz",
+                    "rev": "undefined",
+                    "error": "not_found",
+                    "reason": "missing"
+                  }
+                }
+              ]
             }
           ]
         }


Mime
View raw message