Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Commit 6874283

Browse files
bessbdflimzy
authored andcommitted
All docs post all params (#462)
Update POST for _all_docs In apache/couchdb#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 <flimzy@flimzy.com>
1 parent f9bb181 commit 6874283

File tree

2 files changed

+26
-40
lines changed

2 files changed

+26
-40
lines changed

src/api/database/bulk-api.rst

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,11 @@
9595
}
9696
9797
.. http:post:: /{db}/_all_docs
98-
:synopsis: Returns certain rows from the built-in view of all documents
98+
:synopsis: Returns a built-in view of all documents in this database
9999

100-
The ``POST`` to ``_all_docs`` allows to specify multiple keys to be
101-
selected from the database. This enables you to request multiple
102-
documents in a single request, in place of multiple :get:`/{db}/{docid}`
103-
requests.
104-
105-
:param db: Database name
106-
:<header Content-Type: :mimetype:`application/json`
107-
:<json array keys: Return only documents that match the specified keys.
108-
*Optional*
109-
:>header Content-Type: - :mimetype:`application/json`
110-
:code 200: Request completed successfully
111-
:code 404: Requested database not found
100+
:method:`POST` `_all_docs` functionality supports identical parameters and behavior
101+
as specified in the :get:`/{db}/_all_docs` API but allows for the query string
102+
parameters to be supplied as keys in a JSON object in the body of the `POST` request.
112103

113104
**Request**:
114105

@@ -167,7 +158,7 @@
167158
database. The information is returned as a JSON structure containing meta
168159
information about the return structure, including a list of all design
169160
documents and basic contents, consisting the ID, revision and key. The key
170-
is the from the design document's ``_id``.
161+
is the design document's ``_id``.
171162

172163
:param db: Database name
173164
:<header Accept: - :mimetype:`application/json`
@@ -278,16 +269,13 @@
278269
}
279270
280271
.. http:post:: /{db}/_design_docs
281-
:synopsis: Returns certain rows from the built-in view of all design
282-
documents
272+
:synopsis: Returns a built-in view of all design documents in this database
283273

284-
The ``POST`` to ``_design_docs`` allows to specify multiple keys to be
285-
selected from the database. This enables you to request multiple
286-
design documents in a single request, in place of multiple
287-
:get:`/{db}/{docid}` requests.
274+
:method:`POST` `_design_docs` functionality supports identical parameters and behavior
275+
as specified in the :get:`/{db}/_design_docs` API but allows for the query string
276+
parameters to be supplied as keys in a JSON object in the body of the `POST` request.
288277

289-
The request body should contain a list of the keys to be returned as an
290-
array to a ``keys`` object. For example:
278+
**Request**:
291279

292280
.. code-block:: http
293281

src/api/local.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,41 +72,41 @@ A list of the available methods and URL paths are provided below:
7272
- :mimetype:`text/plain`
7373
:query boolean conflicts: Includes `conflicts` information in response.
7474
Ignored if `include_docs` isn't ``true``. Default is ``false``.
75-
:query boolean descending: Return the design documents in descending by
75+
:query boolean descending: Return the local documents in descending by
7676
key order. Default is ``false``.
7777
:query string endkey: Stop returning records when the specified key is
7878
reached. *Optional*.
7979
:query string end_key: Alias for `endkey` param.
8080
:query string endkey_docid: Stop returning records when the specified
81-
design document ID is reached. *Optional*.
81+
local document ID is reached. *Optional*.
8282
:query string end_key_doc_id: Alias for `endkey_docid` param.
83-
:query boolean include_docs: Include the full content of the design
83+
:query boolean include_docs: Include the full content of the local
8484
documents in the return. Default is ``false``.
8585
:query boolean inclusive_end: Specifies whether the specified end key
8686
should be included in the result. Default is ``true``.
87-
:query string key: Return only design documents that match the specified
87+
:query string key: Return only local documents that match the specified
8888
key. *Optional*.
89-
:query string keys: Return only design documents that match the specified
89+
:query string keys: Return only local documents that match the specified
9090
keys. *Optional*.
91-
:query number limit: Limit the number of the returned design documents to
91+
:query number limit: Limit the number of the returned local documents to
9292
the specified number. *Optional*.
9393
:query number skip: Skip this number of records before starting to return
9494
the results. Default is ``0``.
9595
:query string startkey: Return records starting with the specified key.
9696
*Optional*.
9797
:query string start_key: Alias for `startkey` param.
9898
:query string startkey_docid: Return records starting with the specified
99-
design document ID. *Optional*.
99+
local document ID. *Optional*.
100100
:query string start_key_doc_id: Alias for `startkey_docid` param.
101101
:query boolean update_seq: Response includes an ``update_seq`` value
102102
indicating which sequence id of the underlying database the view
103103
reflects. Default is ``false``.
104104
:>header Content-Type: - :mimetype:`application/json`
105105
- :mimetype:`text/plain; charset=utf-8`
106-
:>json number offset: Offset where the design document list started
106+
:>json number offset: Offset where the local document list started
107107
:>json array rows: Array of view row objects. By default the information
108-
returned contains only the design document ID and revision.
109-
:>json number total_rows: Number of design documents in the database. Note
108+
returned contains only the local document ID and revision.
109+
:>json number total_rows: Number of local documents in the database. Note
110110
that this is not the number of rows returned in the actual query.
111111
:>json number update_seq: Current update sequence for the database
112112
:code 200: Request completed successfully
@@ -173,16 +173,14 @@ A list of the available methods and URL paths are provided below:
173173
}
174174
175175
.. http:post:: /{db}/_local_docs
176-
:synopsis: Returns certain rows from the built-in view of all local
177-
documents
176+
:synopsis: Returns a built-in view of all local (non-replicating) documents
177+
in this database
178178

179-
The ``POST`` to ``_local_docs`` allows to specify multiple keys to be
180-
selected from the database. This enables you to request multiple
181-
local documents in a single request, in place of multiple
182-
:get:`/{db}/_local/{docid}` requests.
179+
:method:`POST` `_local_docs` functionality supports identical parameters and behavior
180+
as specified in the :get:`/{db}/_local_docs` API but allows for the query string
181+
parameters to be supplied as keys in a JSON object in the body of the `POST` request.
183182

184-
The request body should contain a list of the keys to be returned as an
185-
array to a ``keys`` object. For example:
183+
**Request**:
186184

187185
.. code-block:: http
188186

0 commit comments

Comments
 (0)