You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2019/12/09 13:33:47 UTC

[couchdb-documentation] branch master updated: All docs post all params (#462)

This is an automated email from the ASF dual-hosted git repository.

garren 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 6874283  All docs post all params (#462)
6874283 is described below

commit 6874283723476f64a4b685e62b1533c26dabe8a6
Author: Bessenyei Balázs Donát <be...@users.noreply.github.com>
AuthorDate: Mon Dec 9 14:33:39 2019 +0100

    All docs post all params (#462)
    
    Update POST for _all_docs
    
    In https://github.com/apache/couchdb/pull/2343 the way POST _all_docs works
    is altered so that the same functionality is available as in GET _all_docs.
    
    This commit updates the POST _all_docs documentation to reflect this new behavior.
    
    Co-Authored-By: Jonathan Hall <fl...@flimzy.com>
---
 src/api/database/bulk-api.rst | 32 ++++++++++----------------------
 src/api/local.rst             | 34 ++++++++++++++++------------------
 2 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/src/api/database/bulk-api.rst b/src/api/database/bulk-api.rst
index 1257ee1..f458935 100644
--- a/src/api/database/bulk-api.rst
+++ b/src/api/database/bulk-api.rst
@@ -95,20 +95,11 @@
         }
 
 .. http:post:: /{db}/_all_docs
-    :synopsis: Returns certain rows from the built-in view of all documents
+    :synopsis: Returns a built-in view of all documents in this database
 
-    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 :get:`/{db}/{docid}`
-    requests.
-
-    :param db: Database name
-    :<header Content-Type: :mimetype:`application/json`
-    :<json array keys: Return only documents that match the specified keys.
-      *Optional*
-    :>header Content-Type: - :mimetype:`application/json`
-    :code 200: Request completed successfully
-    :code 404: Requested database not found
+    :method:`POST` `_all_docs` functionality supports identical parameters and behavior
+    as specified in the :get:`/{db}/_all_docs` API but allows for the query string
+    parameters to be supplied as keys in a JSON object in the body of the `POST` request.
 
     **Request**:
 
@@ -167,7 +158,7 @@
     database. The information is returned as a JSON structure containing meta
     information about the return structure, including a list of all design
     documents and basic contents, consisting the ID, revision and key. The key
-    is the from the design document's ``_id``.
+    is the design document's ``_id``.
 
     :param db: Database name
     :<header Accept: - :mimetype:`application/json`
@@ -278,16 +269,13 @@
         }
 
 .. http:post:: /{db}/_design_docs
-    :synopsis: Returns certain rows from the built-in view of all design
-      documents
+    :synopsis: Returns a built-in view of all design documents in this database
 
-    The ``POST`` to ``_design_docs`` allows to specify multiple keys to be
-    selected from the database. This enables you to request multiple
-    design documents in a single request, in place of multiple
-    :get:`/{db}/{docid}` requests.
+    :method:`POST` `_design_docs` functionality supports identical parameters and behavior
+    as specified in the :get:`/{db}/_design_docs` API but allows for the query string
+    parameters to be supplied as keys in a JSON object in the body of the `POST` request.
 
-    The request body should contain a list of the keys to be returned as an
-    array to a ``keys`` object. For example:
+    **Request**:
 
     .. code-block:: http
 
diff --git a/src/api/local.rst b/src/api/local.rst
index 0698ae2..966cb2b 100644
--- a/src/api/local.rst
+++ b/src/api/local.rst
@@ -72,23 +72,23 @@ A list of the available methods and URL paths are provided below:
                      - :mimetype:`text/plain`
     :query boolean conflicts: Includes `conflicts` information in response.
       Ignored if `include_docs` isn't ``true``. Default is ``false``.
-    :query boolean descending: Return the design documents in descending by
+    :query boolean descending: Return the local documents in descending by
       key order. Default is ``false``.
     :query string endkey: Stop returning records when the specified key is
       reached. *Optional*.
     :query string end_key: Alias for `endkey` param.
     :query string endkey_docid: Stop returning records when the specified
-        design document ID is reached. *Optional*.
+        local document ID is reached. *Optional*.
     :query string end_key_doc_id: Alias for `endkey_docid` param.
-    :query boolean include_docs: Include the full content of the design
+    :query boolean include_docs: Include the full content of the local
       documents in the return. Default is ``false``.
     :query boolean inclusive_end: Specifies whether the specified end key
       should be included in the result. Default is ``true``.
-    :query string key: Return only design documents that match the specified
+    :query string key: Return only local documents that match the specified
       key. *Optional*.
-    :query string keys: Return only design documents that match the specified
+    :query string keys: Return only local documents that match the specified
       keys. *Optional*.
-    :query number limit: Limit the number of the returned design documents to
+    :query number limit: Limit the number of the returned local documents to
       the specified number. *Optional*.
     :query number skip: Skip this number of records before starting to return
       the results. Default is ``0``.
@@ -96,17 +96,17 @@ A list of the available methods and URL paths are provided below:
       *Optional*.
     :query string start_key: Alias for `startkey` param.
     :query string startkey_docid: Return records starting with the specified
-      design document ID. *Optional*.
+      local document ID. *Optional*.
     :query string start_key_doc_id: Alias for `startkey_docid` param.
     :query boolean update_seq: Response includes an ``update_seq`` value
       indicating which sequence id of the underlying database the view
       reflects. Default is ``false``.
     :>header Content-Type: - :mimetype:`application/json`
                            - :mimetype:`text/plain; charset=utf-8`
-    :>json number offset: Offset where the design document list started
+    :>json number offset: Offset where the local document list started
     :>json array rows: Array of view row objects. By default the information
-      returned contains only the design document ID and revision.
-    :>json number total_rows: Number of design documents in the database. Note
+      returned contains only the local document ID and revision.
+    :>json number total_rows: Number of local documents in the database. Note
       that this is not the number of rows returned in the actual query.
     :>json number update_seq: Current update sequence for the database
     :code 200: Request completed successfully
@@ -173,16 +173,14 @@ A list of the available methods and URL paths are provided below:
         }
 
 .. http:post:: /{db}/_local_docs
-    :synopsis: Returns certain rows from the built-in view of all local
-      documents
+    :synopsis: Returns a built-in view of all local (non-replicating) documents
+      in this database
 
-    The ``POST`` to ``_local_docs`` allows to specify multiple keys to be
-    selected from the database. This enables you to request multiple
-    local documents in a single request, in place of multiple
-    :get:`/{db}/_local/{docid}` requests.
+    :method:`POST` `_local_docs` functionality supports identical parameters and behavior
+    as specified in the :get:`/{db}/_local_docs` API but allows for the query string
+    parameters to be supplied as keys in a JSON object in the body of the `POST` request.
 
-    The request body should contain a list of the keys to be returned as an
-    array to a ``keys`` object. For example:
+    **Request**:
 
     .. code-block:: http