You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/07/24 14:25:07 UTC
[30/50] [abbrv] git commit: updated
refs/heads/1781-reorganize-and-improve-docs to fa11c25
Split API articles into small files focused on specific problem.
Small files more conveniently to edit than the large ones.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d67c2733
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d67c2733
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d67c2733
Branch: refs/heads/1781-reorganize-and-improve-docs
Commit: d67c27332e60fd0b4eb58d22568469afa34bed42
Parents: 57e35fe
Author: Alexander Shorin <kx...@apache.org>
Authored: Wed Jul 24 04:22:06 2013 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Wed Jul 24 10:54:24 2013 +0400
----------------------------------------------------------------------
share/doc/build/Makefile.am | 91 +-
share/doc/src/api/authn.rst | 460 -------
share/doc/src/api/configuration.rst | 307 -----
share/doc/src/api/database.rst | 1500 -----------------------
share/doc/src/api/database/all-docs.rst | 244 ++++
share/doc/src/api/database/bulk-docs.rst | 390 ++++++
share/doc/src/api/database/changes.rst | 144 +++
share/doc/src/api/database/common.rst | 195 +++
share/doc/src/api/database/compact.rst | 168 +++
share/doc/src/api/database/index.rst | 113 ++
share/doc/src/api/database/misc.rst | 179 +++
share/doc/src/api/database/security.rst | 99 ++
share/doc/src/api/database/temp-views.rst | 55 +
share/doc/src/api/ddoc/common.rst | 464 +++++++
share/doc/src/api/ddoc/index.rst | 37 +
share/doc/src/api/ddoc/render.rst | 126 ++
share/doc/src/api/ddoc/rewrites.rst | 24 +
share/doc/src/api/ddoc/views.rst | 708 +++++++++++
share/doc/src/api/design.rst | 1306 --------------------
share/doc/src/api/document/attachments.rst | 242 ++++
share/doc/src/api/document/common.rst | 781 ++++++++++++
share/doc/src/api/document/index.rst | 53 +
share/doc/src/api/documents.rst | 1045 ----------------
share/doc/src/api/index.rst | 11 +-
share/doc/src/api/misc.rst | 898 --------------
share/doc/src/api/server/authn.rst | 460 +++++++
share/doc/src/api/server/common.rst | 862 +++++++++++++
share/doc/src/api/server/configuration.rst | 307 +++++
share/doc/src/api/server/index.rst | 75 ++
share/doc/src/config/http-handlers.rst | 44 +-
share/doc/src/config/http.rst | 2 +-
share/doc/src/intro.rst | 4 +-
share/doc/src/replication/intro.rst | 2 +-
33 files changed, 5825 insertions(+), 5571 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/d67c2733/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index a85db77..c9fc423 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -45,15 +45,30 @@ html_files = \
html/_images/futon-editeddoc.png \
html/_images/futon-overview.png \
html/_images/futon-replform.png \
- html/_sources/api/authn.txt \
- html/_sources/api/basics.txt \
- html/_sources/api/configuration.txt \
- html/_sources/api/database.txt \
- html/_sources/api/design.txt \
- html/_sources/api/documents.txt \
- html/_sources/api/local.txt \
- html/_sources/api/misc.txt \
- html/_sources/api/reference.txt \
+ html/_source/api/basics.txt \
+ html/_source/api/index.txt \
+ html/_source/api/local.txt \
+ html/_source/api/database/all-docs.txt \
+ html/_source/api/database/bulk-docs.txt \
+ html/_source/api/database/changes.txt \
+ html/_source/api/database/common.txt \
+ html/_source/api/database/compact.txt \
+ html/_source/api/database/index.txt \
+ html/_source/api/database/misc.txt \
+ html/_source/api/database/security.txt \
+ html/_source/api/database/temp-views.txt \
+ html/_source/api/document/attachments.txt \
+ html/_source/api/document/common.txt \
+ html/_source/api/document/index.txt \
+ html/_source/api/ddoc/common.txt \
+ html/_source/api/ddoc/index.txt \
+ html/_source/api/ddoc/render.txt \
+ html/_source/api/ddoc/rewrites.txt \
+ html/_source/api/ddoc/views.txt \
+ html/_source/api/server/authn.txt \
+ html/_source/api/server/common.txt \
+ html/_source/api/server/configuration.txt \
+ html/_source/api/server/index.txt \
html/_sources/config/auth.txt \
html/_sources/config/compaction.txt \
html/_sources/config/couchdb.txt \
@@ -106,15 +121,30 @@ html_files = \
html/_static/up-pressed.png \
html/_static/up.png \
html/_static/websupport.js \
- html/api/authn.html \
html/api/basics.html \
- html/api/configuration.html \
- html/api/database.html \
- html/api/design.html \
- html/api/documents.html \
+ html/api/index.html \
html/api/local.html \
- html/api/misc.html \
- html/api/reference.html \
+ html/api/database/all-docs.html \
+ html/api/database/bulk-docs.html \
+ html/api/database/changes.html \
+ html/api/database/common.html \
+ html/api/database/compact.html \
+ html/api/database/index.html \
+ html/api/database/misc.html \
+ html/api/database/security.html \
+ html/api/database/temp-views.html \
+ html/api/document/attachments.html \
+ html/api/document/common.html \
+ html/api/document/index.html \
+ html/api/ddoc/common.html \
+ html/api/ddoc/index.html \
+ html/api/ddoc/render.html \
+ html/api/ddoc/rewrites.html \
+ html/api/ddoc/views.html \
+ html/api/server/authn.html \
+ html/api/server/common.html \
+ html/api/server/configuration.html \
+ html/api/server/index.html \
html/config/auth.html \
html/config/compaction.html \
html/config/couchdb.html \
@@ -165,15 +195,30 @@ image_files = \
../images/logo.png
src_files = \
- ../src/api/authn.rst \
../src/api/basics.rst \
- ../src/api/configuration.rst \
- ../src/api/database.rst \
- ../src/api/design.rst \
- ../src/api/documents.rst \
+ ../src/api/index.rst \
../src/api/local.rst \
- ../src/api/misc.rst \
- ../src/api/reference.rst \
+ ../src/api/database/all-docs.rst \
+ ../src/api/database/bulk-docs.rst \
+ ../src/api/database/changes.rst \
+ ../src/api/database/common.rst \
+ ../src/api/database/compact.rst \
+ ../src/api/database/index.rst \
+ ../src/api/database/misc.rst \
+ ../src/api/database/security.rst \
+ ../src/api/database/temp-views.rst \
+ ../src/api/document/attachments.rst \
+ ../src/api/document/common.rst \
+ ../src/api/document/index.rst \
+ ../src/api/ddoc/common.rst \
+ ../src/api/ddoc/index.rst \
+ ../src/api/ddoc/render.rst \
+ ../src/api/ddoc/rewrites.rst \
+ ../src/api/ddoc/views.rst \
+ ../src/api/server/authn.rst \
+ ../src/api/server/common.rst \
+ ../src/api/server/configuration.rst \
+ ../src/api/server/index.rst \
../src/config/auth.rst \
../src/config/compaction.rst \
../src/config/couchdb.rst \
http://git-wip-us.apache.org/repos/asf/couchdb/blob/d67c2733/share/doc/src/api/authn.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/authn.rst b/share/doc/src/api/authn.rst
deleted file mode 100644
index 083a262..0000000
--- a/share/doc/src/api/authn.rst
+++ /dev/null
@@ -1,460 +0,0 @@
-.. Licensed under the Apache License, Version 2.0 (the "License"); you may not
-.. use this file except in compliance with the License. You may obtain a copy of
-.. the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-.. License for the specific language governing permissions and limitations under
-.. the License.
-
-.. _api/auth:
-
-======================
-Authentication Methods
-======================
-
-The CouchDB Authentication methods provide an interface for obtaining
-session and authorization data.
-
-A list of the available methods and URL paths are provided below:
-
-+--------+-------------------------+-------------------------------------------+
-| Method | Path | Description |
-+========+=========================+===========================================+
-| GET | /_session | Returns cookie based login user |
-| | | information |
-+--------+-------------------------+-------------------------------------------+
-| POST | /_session | Do cookie based user login |
-+--------+-------------------------+-------------------------------------------+
-| DELETE | /_session | Logout cookie based user |
-+--------+-------------------------+-------------------------------------------+
-
-.. note:: We're also strongly recommend you to
- :ref:`setup SSL <config/ssl>` to improve all authentication methods security.
-
-
-.. _api/auth/basic:
-
-Basic Authentication
-====================
-
-`Basic authentication`_ (:rfc:`2617`) is a quick and simple way to be
-authenticated by CouchDB. The main flaw of this simplicity is the need to send
-user credentials with each request which may be insecure and hurts operations
-performance (since CouchDB must compute password hash with every request):
-
-.. code-block:: http
-
- GET / HTTP/1.1
- Authorization: Basic cm9vdDpyZWxheA==
- Host: localhost:5984
- Accept: application/json
-
-.. code-block:: http
-
- HTTP/1.1 200 OK
- Server: CouchDB/1.3.0 (Erlang OTP/R15B02)
- Date: Mon, 03 Dec 2012 00:44:47 GMT
- Content-Type: application/json
- Content-Length: 177
- Cache-Control: must-revalidate
-
-.. code-block:: javascript
-
- {
- "couchdb":"Welcome",
- "uuid":"0a959b9b8227188afc2ac26ccdf345a6",
- "version":"1.3.0",
- "vendor": {
- "version":"1.3.0",
- "name":"The Apache Software Foundation"
- }
- }
-
-.. _Basic authentication: http://en.wikipedia.org/wiki/Basic_access_authentication
-
-
-.. _api/auth/cookie:
-
-Cookie Authentication
-=====================
-
-For cookie authentication (:rfc:`2109`) CouchDB generates a one-time token that
-the client can use for next requests to CouchDB. When CouchDB sees non expired
-the token in a subsequent request, it will authenticate user by this token
-without requesting the password again. By default, cookies are valid for
-10 minutes, but it's :ref:`adjustable <config/couch_httpd_auth/timeout>`.
-Also it's possible to make cookies
-:ref:`persistent <config/couch_httpd_auth/allow_persistent_cookies>`
-
-To obtain the first token and thus authenticate a user for the first time, the
-`username` and `password` must be sent to the
-:ref:`_session API <api/auth/session>`.
-
-.. _api/auth/session:
-.. _api/auth/session.post:
-
-``POST /_session``
-------------------
-
-* **Method**: ``POST /_session``
-* **Request**: User credentials
-* **Response**: User information
-* **Admin Privileges Required**: no
-* **Query Arguments**:
-
- * **Argument**: next
-
- * **Description**: Enforces redirect after successful login
- * **Optional**: yes
- * **Value**: Relative path from server root
-
-* **HTTP Headers**
-
- * **Header**: ``Content-Type``
-
- * **Description**: Credentials data format
- * **Optional**: no
- * **Value**: ``application/x-www-form-urlencoded``
-
-* **Return Codes**:
-
- * **200**:
- Successfully authenticated
-
- * **302**:
- Redirect after successful authentication
-
- * **401**:
- Username or password wasn't recognized
-
-Initiates new session for specified user credentials by providing `Cookie`
-value. Credentials should be defined in ``application/x-www-form-urlencoded``
-format with `name` and `password` fields.
-
-.. code-block:: http
-
- POST /_session HTTP/1.1
- Host: localhost:5984
- Accept: application/json
- Content-Length: 24
- Content-Type: application/x-www-form-urlencoded
-
-.. code-block:: text
-
- name=root&password=relax
-
-In case of success will be returned next response:
-
-.. code-block:: http
-
- HTTP/1.1 200 OK
- Set-Cookie: AuthSession=cm9vdDo1MEJCRkYwMjq0LO0ylOIwShrgt8y-UkhI-c6BGw; Version=1; Path=/; HttpOnly
- Server: CouchDB/1.3.0 (Erlang OTP/R15B02)
- Date: Mon, 03 Dec 2012 01:23:14 GMT
- Content-Type: application/json
- Content-Length: 43
- Cache-Control: must-revalidate
-
-.. code-block:: javascript
-
- {"ok":true,"name":null,"roles":["_admin"]}
-
-If ``next`` query parameter was provided the response will trigger redirection
-to the specified location in case of successful authentication:
-
-.. code-block:: http
-
- GET /_session?next=/blog/_design/sofa/_rewrite/recent-posts HTTP/1.1
- Host: localhost:5984
- Accept: application/json
-
-.. code-block:: http
-
- HTTP/1.1 302 Moved Temporarily
- Set-Cookie: AuthSession=cm9vdDo1MEJDMDEzRTp7Vu5GKCkTxTVxwXbpXsBARQWnhQ; Version=1; Path=/; HttpOnly
- Server: CouchDB/1.3.0 (Erlang OTP/R15B02)
- Location: http://localhost:5984/blog/_design/sofa/_rewrite/recent-posts
- Date: Mon, 03 Dec 2012 01:32:46 GMT
- Content-Type: application/json
- Content-Length: 43
- Cache-Control: must-revalidate
-
-.. code-block:: javascript
-
- {"ok":true,"name":null,"roles":["_admin"]}
-
-
-.. _api/auth/session.get:
-
-``GET /_session``
------------------
-
-* **Method**: ``GET /_session``
-* **Request**: None
-* **Response**: User information
-* **Admin Privileges Required**: no
-* **Query Arguments**:
-
- * **Argument**: basic
-
- * **Description**: Accept `Basic Auth` by requesting this resource
- * **Optional**: yes
- * **Value**: ``true``
-
-* **Return Codes**:
-
- * **200**:
- Successfully authenticated.
-
- * **401**:
- Username or password wasn't recognized.
-
-Returns complete information about authenticated user:
-
-.. code-block:: http
-
- GET /_session HTTP/1.1
- Host: localhost:5984
- Accept: application/json
- Cookie: AuthSession=cm9vdDo1MEJDMDQxRDpqb-Ta9QfP9hpdPjHLxNTKg_Hf9w
-
-.. code-block:: javascript
-
- {
- "info": {
- "authenticated": "cookie",
- "authentication_db": "_users",
- "authentication_handlers": [
- "oauth",
- "cookie",
- "default"
- ]
- },
- "ok": true,
- "userCtx": {
- "name": "root",
- "roles": [
- "_admin"
- ]
- }
- }
-
-This information contains :ref:`userctx_object`, authentication method and
-available ones and authentication database.
-
-.. _api/auth/session.delete:
-
-``DELETE /_session``
---------------------
-
-* **Method**: ``DELETE /_session``
-* **Request**: None
-* **Response**: Status
-* **Admin Privileges Required**: no
-
-* **Return Codes**:
-
- * **200**:
- Successfully close session.
-
- * **401**:
- Username or password wasn't recognized.
-
-Closes user's session. If everything is ok, the response is:
-
-.. code-block:: javascript
-
- {"ok":true}
-
-
-.. _api/auth/proxy:
-
-Proxy Authentication
-====================
-
-.. note::
- To use this authentication method make sure that the
- ``{couch_httpd_auth, proxy_authentication_handler}`` value in added to
- the list of the active
- :ref:`authentication handlers <config/httpd/authentication_handlers>`:
-
- .. code-block:: ini
-
- [httpd]
- authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, proxy_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
-
-
-`Proxy authentication` is very useful in case when your application is already
-uses some external authentication service and you won't duplicate users and
-their roles in CouchDB.
-
-This authentication method allows creation of a :ref:`userctx_object` for
-remotely authenticated user. By default, the client just need to pass specific
-headers to CouchDB with related request:
-
-- :ref:`X-Auth-CouchDB-UserName <config/couch_httpd_auth/x_auth_username>`:
- username;
-- :ref:`X-Auth-CouchDB-Roles <config/couch_httpd_auth/x_auth_roles>`:
- list of user roles separated by a comma (``,``);
-- :ref:`X-Auth-CouchDB-Token <config/couch_httpd_auth/x_auth_token>`:
- authentication token. Optional, but strongly recommended to
- :ref:`force token be required <config/couch_httpd_auth/proxy_use_secret>`
- to prevent requests from untrusted sources.
-
-.. code-block:: http
-
- GET /_session HTTP/1.1
- Host: localhost:5984
- Accept: application/json
- Content-Type: application/json; charset=utf-8
- X-Auth-CouchDB-Roles: users,blogger
- X-Auth-CouchDB-UserName: foo
-
-CouchDB sends the response:
-
-.. code-block:: http
-
- HTTP/1.1 200 OK
- Cache-Control: must-revalidate
- Content-Length: 190
- Content-Type: application/json
- Date: Fri, 14 Jun 2013 10:16:03 GMT
- Server: CouchDB/1.3.0 (Erlang OTP/R15B03)
-
-.. code-block:: javascript
-
- {
- "info": {
- "authenticated": "proxy",
- "authentication_db": "_users",
- "authentication_handlers": [
- "oauth",
- "cookie",
- "proxy",
- "default"
- ]
- },
- "ok": true,
- "userCtx": {
- "name": "foo",
- "roles": [
- "users",
- "blogger"
- ]
- }
- }
-
-
-Note, that you don't need to request :ref:`session <api/auth/session>` resource
-to be authenticated by this method if all required HTTP headers are provided.
-
-
-.. _api/auth/oauth:
-
-OAuth Authentication
-====================
-
-CouchDB supports OAuth 1.0 authentication (:rfc:`5849`). OAuth provides a method
-for clients to access server resources without sharing real credentials
-(username and password).
-
-First, :ref:`configure oauth <config/oauth>`, by setting consumer and token
-with their secrets and binding token to real CouchDB username.
-
-Probably, it's not good idea to work with plain curl, let use some scripting
-language like Python:
-
-.. code-block:: python
-
- #!/usr/bin/env python2
- from oauth import oauth # pip install oauth
- import httplib
-
- URL = 'http://localhost:5984/_session'
- CONSUMER_KEY = 'consumer1'
- CONSUMER_SECRET = 'sekr1t'
- TOKEN = 'token1'
- SECRET = 'tokensekr1t'
-
- consumer = oauth.OAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET)
- token = oauth.OAuthToken(TOKEN, SECRET)
- req = oauth.OAuthRequest.from_consumer_and_token(
- consumer,
- token=token,
- http_method='GET',
- http_url=URL,
- parameters={}
- )
- req.sign_request(oauth.OAuthSignatureMethod_HMAC_SHA1(), consumer,token)
-
- headers = req.to_header()
- headers['Accept'] = 'application/json'
-
- con = httplib.HTTPConnection('localhost', 5984)
- con.request('GET', URL, headers=headers)
- resp = con.getresponse()
- print resp.read()
-
-or Ruby:
-
-.. code-block:: ruby
-
- #!/usr/bin/env ruby
-
- require 'oauth' # gem install oauth
-
- URL = 'http://localhost:5984'
- CONSUMER_KEY = 'consumer1'
- CONSUMER_SECRET = 'sekr1t'
- TOKEN = 'token1'
- SECRET = 'tokensekr1t'
-
- @consumer = OAuth::Consumer.new CONSUMER_KEY,
- CONSUMER_SECRET,
- {:site => URL}
-
- @access_token = OAuth::AccessToken.new(@consumer, TOKEN, SECRET)
-
- puts @access_token.get('/_session').body
-
-
-Both snippets produces similar request and response pair:
-
-.. code-block:: http
-
- GET /_session HTTP/1.1
- Host: localhost:5984
- Accept: application/json
- Authorization: OAuth realm="", oauth_nonce="81430018", oauth_timestamp="1374561749", oauth_consumer_key="consumer1", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="token1", oauth_signature="o4FqJ8%2B9IzUpXH%2Bk4rgnv7L6eTY%3D"
-
-.. code-block:: http
-
- HTTP/1.1 200 OK
- Cache-Control : must-revalidate
- Content-Length : 167
- Content-Type : application/json
- Date : Tue, 23 Jul 2013 06:51:15 GMT
- Server : CouchDB/1.3.1 (Erlang OTP/R16B)
-
-.. code-block:: javascript
-
- {
- "ok": true,
- "info": {
- "authenticated": "oauth"
- "authentication_db": "_users",
- "authentication_handlers": ["oauth", "cookie", "default"]
- },
- "userCtx": {
- "name": "couchdb_username",
- "roles": []
- }
- }
-
-There we'd requested the :ref:`_session <api/auth/session>` resource to ensure
-that authentication was successful and target CouchDB username is correct.
-Change the target URL to request required resource.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/d67c2733/share/doc/src/api/configuration.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/configuration.rst b/share/doc/src/api/configuration.rst
deleted file mode 100644
index 9fdec09..0000000
--- a/share/doc/src/api/configuration.rst
+++ /dev/null
@@ -1,307 +0,0 @@
-.. Licensed under the Apache License, Version 2.0 (the "License"); you may not
-.. use this file except in compliance with the License. You may obtain a copy of
-.. the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-.. License for the specific language governing permissions and limitations under
-.. the License.
-
-.. _api/config:
-
-=====================
-Configuration Methods
-=====================
-
-The CouchDB API Server Configuration Methods provide an interface to
-query and update the various configuration values within a running
-CouchDB instance.
-
-A list of the available methods and URL paths are provided below:
-
-+--------+-------------------------+-------------------------------------------+
-| Method | Path | Description |
-+========+=========================+===========================================+
-| GET | /_config | Obtain a list of the entire server |
-| | | configuration |
-+--------+-------------------------+-------------------------------------------+
-| GET | /_config/section | Get all the configuration values for the |
-| | | specified section |
-+--------+-------------------------+-------------------------------------------+
-| GET | /_config/section/key | Get a specific section/configuration value|
-+--------+-------------------------+-------------------------------------------+
-| PUT | /_config/section/key | Set the specified configuration value |
-+--------+-------------------------+-------------------------------------------+
-| DELETE | /_config/section/key | Delete the current setting |
-+--------+-------------------------+-------------------------------------------+
-
-.. _api/config.get:
-
-``GET /_config``
-================
-
-* **Method**: ``GET /_config``
-* **Request**: None
-* **Response**: Returns a structure configuration name and value pairs,
- organized by section
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **200**:
- Request completed successfully.
-
-Returns the entire CouchDB server configuration as a JSON structure. The
-structure is organized by different configuration sections, with
-individual values.
-
-For example, to get the configuration for a server:
-
-.. code-block:: http
-
- GET http://couchdb:5984/_config
- Accept: application/json
-
-The response is the JSON structure:
-
-.. code-block:: javascript
-
- {
- "query_server_config" : {
- "reduce_limit" : "true"
- },
- "couchdb" : {
- "os_process_timeout" : "5000",
- "max_attachment_chunk_size" : "4294967296",
- "max_document_size" : "4294967296",
- "uri_file" : "/var/lib/couchdb/couch.uri",
- "max_dbs_open" : "100",
- "view_index_dir" : "/var/lib/couchdb",
- "util_driver_dir" : "/usr/lib64/couchdb/erlang/lib/couch-1.0.1/priv/lib",
- "database_dir" : "/var/lib/couchdb",
- "delayed_commits" : "true"
- },
- "attachments" : {
- "compressible_types" : "text/*, application/javascript, application/json, application/xml",
- "compression_level" : "8"
- },
- "uuids" : {
- "algorithm" : "utc_random"
- },
- "daemons" : {
- "view_manager" : "{couch_view, start_link, []}",
- "auth_cache" : "{couch_auth_cache, start_link, []}",
- "uuids" : "{couch_uuids, start, []}",
- "stats_aggregator" : "{couch_stats_aggregator, start, []}",
- "query_servers" : "{couch_query_servers, start_link, []}",
- "httpd" : "{couch_httpd, start_link, []}",
- "stats_collector" : "{couch_stats_collector, start, []}",
- "db_update_notifier" : "{couch_db_update_notifier_sup, start_link, []}",
- "external_manager" : "{couch_external_manager, start_link, []}"
- },
- "stats" : {
- "samples" : "[0, 60, 300, 900]",
- "rate" : "1000"
- },
- "httpd" : {
- "vhost_global_handlers" : "_utils, _uuids, _session, _oauth, _users",
- "secure_rewrites" : "true",
- "authentication_handlers" : "{couch_httpd_oauth, oauth_authentication_handler},
- {couch_httpd_auth, cookie_authentication_handler},
- {couch_httpd_auth, default_authentication_handler}",
- "port" : "5984",
- "default_handler" : "{couch_httpd_db, handle_request}",
- "allow_jsonp" : "false",
- "bind_address" : "192.168.0.2",
- "max_connections" : "2048"
- },
- "query_servers" : {
- "javascript" : "/usr/bin/couchjs /usr/share/couchdb/server/main.js"
- },
- "couch_httpd_auth" : {
- "authentication_db" : "_users",
- "require_valid_user" : "false",
- "authentication_redirect" : "/_utils/session.html",
- "timeout" : "600",
- "auth_cache_size" : "50"
- },
- "httpd_db_handlers" : {
- "_design" : "{couch_httpd_db, handle_design_req}",
- "_compact" : "{couch_httpd_db, handle_compact_req}",
- "_view_cleanup" : "{couch_httpd_db, handle_view_cleanup_req}",
- "_temp_view" : "{couch_httpd_view, handle_temp_view_req}",
- "_changes" : "{couch_httpd_db, handle_changes_req}"
- },
- "replicator" : {
- "max_http_sessions" : "10",
- "max_http_pipeline_size" : "10"
- },
- "log" : {
- "include_sasl" : "true",
- "level" : "info",
- "file" : "/var/log/couchdb/couch.log"
- },
- "httpd_design_handlers" : {
- "_update" : "{couch_httpd_show, handle_doc_update_req}",
- "_show" : "{couch_httpd_show, handle_doc_show_req}",
- "_info" : "{couch_httpd_db, handle_design_info_req}",
- "_list" : "{couch_httpd_show, handle_view_list_req}",
- "_view" : "{couch_httpd_view, handle_view_req}",
- "_rewrite" : "{couch_httpd_rewrite, handle_rewrite_req}"
- },
- "httpd_global_handlers" : {
- "_replicate" : "{couch_httpd_misc_handlers, handle_replicate_req}",
- "/" : "{couch_httpd_misc_handlers, handle_welcome_req, <<\"Welcome\">>}",
- "_config" : "{couch_httpd_misc_handlers, handle_config_req}",
- "_utils" : "{couch_httpd_misc_handlers, handle_utils_dir_req, \"/usr/share/couchdb/www\"}",
- "_active_tasks" : "{couch_httpd_misc_handlers, handle_task_status_req}",
- "_session" : "{couch_httpd_auth, handle_session_req}",
- "_log" : "{couch_httpd_misc_handlers, handle_log_req}",
- "favicon.ico" : "{couch_httpd_misc_handlers, handle_favicon_req, \"/usr/share/couchdb/www\"}",
- "_all_dbs" : "{couch_httpd_misc_handlers, handle_all_dbs_req}",
- "_oauth" : "{couch_httpd_oauth, handle_oauth_req}",
- "_restart" : "{couch_httpd_misc_handlers, handle_restart_req}",
- "_uuids" : "{couch_httpd_misc_handlers, handle_uuids_req}",
- "_stats" : "{couch_httpd_stats_handlers, handle_stats_req}"
- }
- }
-
-
-.. _api/config/section:
-.. _api/config/section.get:
-
-``GET /_config/section``
-========================
-
-* **Method**: ``GET /_config/section``
-* **Request**: None
-* **Response**: All the configuration values within a specified section
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **200**:
- Request completed successfully.
-
-Gets the configuration structure for a single section. For example, to
-retrieve the CouchDB configuration section values:
-
-.. code-block:: http
-
- GET http://couchdb:5984/_config/couchdb
- Accept: application/json
-
-The returned JSON contains just the configuration values for this
-section:
-
-.. code-block:: javascript
-
- {
- "os_process_timeout" : "5000",
- "max_attachment_chunk_size" : "4294967296",
- "max_document_size" : "4294967296",
- "uri_file" : "/var/lib/couchdb/couch.uri",
- "max_dbs_open" : "100",
- "view_index_dir" : "/var/lib/couchdb",
- "util_driver_dir" : "/usr/lib64/couchdb/erlang/lib/couch-1.0.1/priv/lib",
- "database_dir" : "/var/lib/couchdb",
- "delayed_commits" : "true"
- }
-
-.. _api/config/section/key:
-.. _api/config/section/key.get:
-
-``GET /_config/section/key``
-============================
-
-* **Method**: ``GET /_config/section/key``
-* **Request**: None
-* **Response**: Value of the specified key/section
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **200**:
- Request completed successfully.
-
-Gets a single configuration value from within a specific configuration
-section. For example, to obtain the current log level:
-
-.. code-block:: http
-
- GET http://couchdb:5984/_config/log/level
- Accept: application/json
-
-Returns the string of the log level:
-
-.. code-block:: javascript
-
- "info"
-
-.. note::
- The returned value will be the JSON of the value, which may be a
- string or numeric value, or an array or object. Some client
- environments may not parse simple strings or numeric values as valid JSON.
-
-.. _api/config/section/key.put:
-
-``PUT /_config/section/key``
-============================
-
-* **Method**: ``PUT /_config/section/key``
-* **Request**: Value structure
-* **Response**: Previous value
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **200**:
- Configuration option updated successfully
-
- * **500**:
- Error setting configuration
-
-Updates a configuration value. The new value should be supplied in the
-request body in the corresponding JSON format. For example, if you are
-setting a string value, you must supply a valid JSON string.
-
-For example, to set the function used to generate UUIDs by the
-``GET /_uuids`` API call to use the ``utc_random`` generator:
-
-.. code-block:: http
-
- PUT http://couchdb:5984/_config/uuids/algorithm
- Content-Type: application/json
-
- "utc_random"
-
-The return value will be empty, with the response code indicating the
-success or failure of the configuration setting.
-
-.. _api/config/section/key.delete:
-
-``DELETE /_config/section/key``
-===============================
-
-* **Method**: ``DELETE /_config/section/key``
-* **Request**: None
-* **Response**: Previous value
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **409**:
- Supplied revision is incorrect or missing
-
-Deletes a configuration value. The returned JSON will be the value of
-the configuration parameter before it was deleted. For example, to
-delete the UUID parameter:
-
-.. code-block:: http
-
- DELETE http://couchdb:5984/_config/uuids/algorithm
- Content-Type: application/json
-
-The returned value is the last configured UUID function:
-
-.. code-block:: javascript
-
- "random"
http://git-wip-us.apache.org/repos/asf/couchdb/blob/d67c2733/share/doc/src/api/database.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/database.rst b/share/doc/src/api/database.rst
deleted file mode 100644
index 38c8f7c..0000000
--- a/share/doc/src/api/database.rst
+++ /dev/null
@@ -1,1500 +0,0 @@
-.. Licensed under the Apache License, Version 2.0 (the "License"); you may not
-.. use this file except in compliance with the License. You may obtain a copy of
-.. the License at
-..
-.. http://www.apache.org/licenses/LICENSE-2.0
-..
-.. Unless required by applicable law or agreed to in writing, software
-.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-.. License for the specific language governing permissions and limitations under
-.. the License.
-
-.. _api/db:
-
-================
-Database Methods
-================
-
-The Database methods provide an interface to an entire database withing
-CouchDB. These are database, rather than document, level requests.
-
-A list of the available methods and URL paths are provided below:
-
-+--------+-------------------------+-------------------------------------------+
-| Method | Path | Description |
-+========+=========================+===========================================+
-| HEAD | /db | Checks database existence |
-+--------+-------------------------+-------------------------------------------+
-| GET | /db | Returns database information |
-+--------+-------------------------+-------------------------------------------+
-| PUT | /db | Create a new database |
-+--------+-------------------------+-------------------------------------------+
-| DELETE | /db | Delete an existing database |
-+--------+-------------------------+-------------------------------------------+
-| GET | /db/_all_docs | Returns a built-in view of all documents |
-| | | in this database |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_all_docs | Returns certain rows from the built-in |
-| | | view of all documents |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_bulk_docs | Insert multiple documents in to the |
-| | | database in a single request |
-+--------+-------------------------+-------------------------------------------+
-| GET | /db/_changes | Returns changes for the given database |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_compact | Starts a compaction for the database |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_compact/design-doc | Starts a compaction for all the views in |
-| | | the selected design document |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_ensure_full_commit | Makes sure all uncommitted changes are |
-| | | written and synchronized to the disk |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_missing_revs | Given a list of document revisions, |
-| | | returns the document revisions that do not|
-| | | exist in the database |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_purge | Purge some historical documents entirely |
-| | | from database history |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_revs_diff | Given a list of document revisions, |
-| | | returns differences between the given |
-| | | revisions and ones that are in the |
-| | | database |
-+--------+-------------------------+-------------------------------------------+
-| GET | /db/_revs_limit | Gets the limit of historical revisions to |
-| | | store for a single document in the |
-| | | database |
-+--------+-------------------------+-------------------------------------------+
-| PUT | /db/_revs_limit | Sets the limit of historical revisions to |
-| | | store for a single document in the |
-| | | database |
-+--------+-------------------------+-------------------------------------------+
-| GET | /db/_security | Returns the special security object for |
-| | | the database |
-+--------+-------------------------+-------------------------------------------+
-| PUT | /db/_security | Sets the special security object for the |
-| | | database |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_temp_view | Execute a given view function for all |
-| | | documents and return the result |
-+--------+-------------------------+-------------------------------------------+
-| POST | /db/_view_cleanup | Removes view files that are not used by |
-| | | any design document |
-+--------+-------------------------+-------------------------------------------+
-
-For all the database methods, the database name within the URL path
-should be the database name that you wish to perform the operation on.
-For example, to obtain the meta information for the database
-``recipes``, you would use the HTTP request:
-
-.. code-block:: http
-
- GET /recipes
-
-For clarity, the form below is used in the URL paths:
-
-.. code-block:: http
-
- GET /db
-
-Where ``db`` is the name of any database.
-
-.. _api/db.head:
-
-``HEAD /db``
-============
-
-* **Method**: ``HEAD /db``
-* **Request**: None
-* **Response**: None
-* **Admin Privileges Required**: no
-* **Return Codes**:
-
- * **200**:
- Database exists.
-
- * **404**:
- Requested database not found.
-
-Returns the HTTP Headers containing a minimal amount of information
-about the specified database. Since the response body is empty this method
-is a lightweight way to check is database exists or not.
-
-.. _api/db.get:
-
-``GET /db``
-===========
-
-* **Method**: ``GET /db``
-* **Request**: None
-* **Response**: Information about the database in JSON format
-* **Admin Privileges Required**: no
-* **Return Codes**:
-
- * **404**:
- The requested content could not be found. The returned content will include
- further information, as a JSON object, if available.
-
-Gets information about the specified database. For example, to retrieve
-the information for the database ``recipe``:
-
-.. code-block:: http
-
- GET http://couchdb:5984/recipes
- Accept: application/json
-
-The JSON response contains meta information about the database. A sample
-of the JSON returned for an empty database is provided below:
-
-.. code-block:: javascript
-
- {
- "compact_running" : false,
- "committed_update_seq" : 375048,
- "disk_format_version" : 5,
- "disk_size" : 33153123,
- "doc_count" : 18386,
- "doc_del_count" : 0,
- "db_name" : "recipes",
- "instance_start_time" : "1290700340925570",
- "purge_seq" : 10,
- "update_seq" : 375048
- }
-
-
-The elements of the returned structure are shown in the table below:
-
-+----------------------------------+-------------------------------------------+
-| Field | Description |
-+==================================+===========================================+
-| committed_update_seq | The number of committed update. |
-+----------------------------------+-------------------------------------------+
-| compact_running | Set to true if the database compaction |
-| | routine is operating on this database. |
-+----------------------------------+-------------------------------------------+
-| db_name | The name of the database. |
-+----------------------------------+-------------------------------------------+
-| disk_format_version | The version of the physical format used |
-| | for the data when it is stored on disk. |
-+----------------------------------+-------------------------------------------+
-| disk_size | Size in bytes of the data as stored on the|
-| | disk. Views indexes are not included in |
-| | the calculation. |
-+----------------------------------+-------------------------------------------+
-| doc_count | A count of the documents in the specified |
-| | database. |
-+----------------------------------+-------------------------------------------+
-| doc_del_count | Number of deleted documents |
-+----------------------------------+-------------------------------------------+
-| instance_start_time | Timestamp of when the database was |
-| | opened, expressed in microseconds since |
-| | the epoch. |
-+----------------------------------+-------------------------------------------+
-| purge_seq | The number of purge operations on the |
-| | database. |
-+----------------------------------+-------------------------------------------+
-| update_seq | The current number of updates to the |
-| | database. |
-+----------------------------------+-------------------------------------------+
-
-.. _api/db.put:
-
-``PUT /db``
-===========
-
-* **Method**: ``PUT /db``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: no
-* **Return Codes**:
-
- * **400**:
- Invalid database name
-
- * **412**:
- Database already exists
-
-Creates a new database. The database name must be composed of one or
-more of the following characters:
-
-- Lowercase characters (``a-z``)
-
-- Name must begin with a lowercase letter
-
-- Digits (``0-9``)
-
-- Any of the characters ``_``, ``$``, ``(``, ``)``, ``+``, ``-``, and
- ``/``.
-
-Trying to create a database that does not meet these requirements will
-return an error quoting these restrictions.
-
-To create the database ``recipes``:
-
-.. code-block:: http
-
- PUT http://couchdb:5984/recipes
- Content-Type: application/json
-
-The returned content contains the JSON status:
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-Anything should be treated as an error, and the problem should be taken
-form the HTTP response code.
-
-.. _api/db.delete:
-
-``DELETE /db``
-==============
-
-* **Method**: ``DELETE /db``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: no
-* **Return Codes**:
-
- * **200**:
- Database has been deleted
-
- * **404**:
- The requested content could not be found. The returned content will include
- further information, as a JSON object, if available.
-
-Deletes the specified database, and all the documents and attachments
-contained within it.
-
-To delete the database ``recipes`` you would send the request:
-
-.. code-block:: http
-
- DELETE http://couchdb:5984/recipes
- Content-Type: application/json
-
-If successful, the returned JSON will indicate success
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-.. _api/db/changes:
-.. _api/db/changes.get:
-
-``GET /db/_changes``
-====================
-
-* **Method**: ``GET /db/_changes``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: no
-* **Query Arguments**:
-
- * **Argument**: doc_ids
-
- * **Description**: Specify the list of documents IDs to be filtered
- * **Optional**: yes
- * **Type**: json
- * **Default**: none
-
- * **Argument**: feed
-
- * **Description**: Type of the :ref:`changes <changes>` feed
- * **Optional**: yes
- * **Type**: string
- * **Default**: normal
- * **Supported Values**:
-
- * **continuous**: :ref:`Continuous <changes/continuous>` mode
- * **eventsource**: :ref:`Event source <changes/eventsource>` mode
- * **longpoll**: :ref:`Long polling <changes/longpoll>` mode
- * **normal**: :ref:`Normal <changes/normal>` mode
-
- * **Argument**: filter
-
- * **Description**: Filter function from a design document to get updates
- * **Optional**: yes
- * **Type**: string
- * **Default**: none
- * **Supported Values**:
-
- * **Argument**: heartbeat
-
- * **Description**: Period after which an empty line is sent during longpoll
- or continuous
- * **Optional**: yes
- * **Type**: numeric
- * **Default**: 60000
- * **Quantity**: milliseconds
-
- * **Argument**: include_docs
-
- * **Description**: Include the document with the result
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: false
-
- * **Argument**: limit
-
- * **Description**: Maximum number of rows rows to return
- * **Optional**: yes
- * **Type**: numeric
- * **Default**: none
-
- * **Argument**: since
-
- * **Description**: Start the results from changes immediately after the
- specified sequence number
- * **Optional**: yes
- * **Type**: numeric
- * **Default**: 0
-
-Obtains a list of the changes made to the database. This can be used to
-monitor for update and modifications to the database for post processing
-or synchronization.
-
-.. seealso::
-
- :ref:`Detailed description of available changes feed types <changes>`
-
-The return structure for ``normal`` and ``longpoll`` modes is a JSON
-array of changes objects, and the last update sequence number. The
-structure is described in the following table.
-
-+----------------------------------+-------------------------------------------+
-| Field | Description |
-+==================================+===========================================+
-| last_seq | Last change sequence number. |
-+----------------------------------+-------------------------------------------+
-| results [array] | Changes made to a database |
-+----------------------------------+-------------------------------------------+
-| changes [array] | List of changes, field-by-field, for this |
-| | document |
-+----------------------------------+-------------------------------------------+
-| id | Document ID |
-+----------------------------------+-------------------------------------------+
-| seq | Update sequence number |
-+----------------------------------+-------------------------------------------+
-
-The return format for ``continuous`` mode the server sends a ``CRLF``
-(carriage-return, linefeed) delimited line for each change. Each line
-contains the `JSON object`_.
-
-You can also request the full contents of each document change (instead
-of just the change notification) by using the ``include_docs``
-parameter.
-
-Filtering
----------
-
-You can filter the contents of the changes feed in a number of ways. The
-most basic way is to specify one or more document IDs to the query. This
-causes the returned structure value to only contain changes for the
-specified IDs. Note that the value of this query argument should be a
-JSON formatted array.
-
-You can also filter the ``_changes`` feed by defining a filter function
-within a design document. The specification for the filter is the same
-as for replication filters. You specify the name of the filter function
-to the ``filter`` parameter, specifying the design document name and
-filter name. For example:
-
-.. code-block:: http
-
- GET /db/_changes?filter=design_doc/filtername
-
-The ``_changes`` feed can be used to watch changes to specific document
-ID's or the list of ``_design`` documents in a database. If the
-``filters`` parameter is set to ``_doc_ids`` a list of doc IDs can be
-passed in the ``doc_ids`` parameter as a JSON array. For more
-information, see :ref:`changes`.
-
-.. _api/db/compact:
-.. _api/db/compact.post:
-
-``POST /db/_compact``
-=====================
-
-* **Method**: ``POST /db/_compact``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **202**:
- Compaction request has been accepted
-
- * **404**:
- The requested content could not be found. The returned content will include
- further information, as a JSON object, if available.
-
-Request compaction of the specified database. Compaction compresses the
-disk database file by performing the following operations:
-
-- Writes a new version of the database file, removing any unused
- sections from the new version during write. Because a new file is
- temporary created for this purpose, you will need twice the current
- storage space of the specified database in order for the compaction
- routine to complete.
-
-- Removes old revisions of documents from the database, up to the
- per-database limit specified by the ``_revs_limit`` database
- parameter. See :ref:`api/db.get`.
-
-Compaction can only be requested on an individual database; you cannot
-compact all the databases for a CouchDB instance. The compaction process
-runs as a background process.
-
-You can determine if the compaction process is operating on a database
-by obtaining the database meta information, the ``compact_running``
-value of the returned database structure will be set to true. See
-:ref:`api/db.get`.
-
-You can also obtain a list of running processes to determine whether
-compaction is currently running. See :ref:`api/misc/active_tasks`.
-
-.. _api/db/compact/ddoc:
-.. _api/db/compact/ddoc.post:
-
-``POST /db/_compact/design-doc``
-================================
-
-* **Method**: ``POST /db/_compact/design-doc``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: yes
-* **Return Codes**:
-
- * **202**:
- Compaction request has been accepted
-
- * **404**:
- The requested content could not be found. The returned content will include
- further information, as a JSON object, if available.
-
-Compacts the view indexes associated with the specified design document.
-You can use this in place of the full database compaction if you know a
-specific set of view indexes have been affected by a recent database
-change.
-
-For example, to compact the views associated with the ``recipes`` design
-document:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_compact/recipes
- Content-Type: application/json
-
-CouchDB will immediately return with a status indicating that the
-compaction request has been received (HTTP status code 202):
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-
-.. _api/db/view_cleanup:
-.. _api/db/view_cleanup.post:
-
-``POST /db/_view_cleanup``
-==========================
-
-* **Method**: ``POST /db/_view_cleanup``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: yes
-
-Cleans up the cached view output on disk for a given view. For example:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_view_cleanup
- Content-Type: application/json
-
-If the request is successful, a basic status message us returned:
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-
-.. _api/db/ensure_full_commit:
-.. _api/db/ensure_full_commit.post:
-
-``POST /db/_ensure_full_commit``
-================================
-
-* **Method**: ``POST /db/_ensure_full_commit``
-* **Request**: None
-* **Response**: JSON success statement
-* **Admin Privileges Required**: no
-* **Return Codes**:
-
- * **202**:
- Commit completed successfully
-
- * **404**:
- The requested content could not be found. The returned content will include
- further information, as a JSON object, if available.
-
-
-Commits any recent changes to the specified database to disk. You should
-call this if you want to ensure that recent changes have been written.
-For example, to commit all the changes to disk for the database
-``recipes`` you would use:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_ensure_full_commit
- Content-Type: application/json
-
-This returns a status message, containing the success message and the
-timestamp for when the CouchDB instance was started:
-
-.. code-block:: javascript
-
- {
- "ok" : true,
- "instance_start_time" : "1288186189373361"
- }
-
-.. _api/db/bulk_docs:
-.. _api/db/bulk_docs.post:
-
-``POST /db/_bulk_docs``
-=======================
-
-* **Method**: ``POST /db/_bulk_docs``
-* **Request**: JSON of the docs and updates to be applied
-* **Response**: JSON success statement
-* **Admin Privileges Required**: no
-
-* **HTTP Headers**:
-
- * **Header**: ``X-Couch-Full-Commit``
-
- * **Description**: Overrides server's commit policy.
- * **Optional**: yes
- * **Values**:
-
- * **true**: Ensures that any non-committed changes are committed to
- physical storage.
- * **false**: Uses the delay commit in opposite to ``true`` value. CouchDB
- responses quickly, but without any guarantees that all data are
- successfully stored on disk.
-
-* **Return Codes**:
-
- * **201**:
- Document(s) have been created or updated
-
-The bulk document API allows you to create and update multiple documents
-at the same time within a single request. The basic operation is similar
-to creating or updating a single document, except that you batch the
-document structure and information and . When creating new documents the
-document ID is optional. For updating existing documents, you must
-provide the document ID, revision information, and new document values.
-
-For both inserts and updates the basic structure of the JSON is the
-same:
-
-+----------------------------------+-------------------------------------------+
-| Field | Description |
-+==================================+===========================================+
-| all_or_nothing (optional) | Sets the database commit mode to use |
-| | all-or-nothing semantics |
-+----------------------------------+-------------------------------------------+
-| docs [array] | Bulk Documents Document |
-+----------------------------------+-------------------------------------------+
-| _id (optional) | List of changes, field-by-field, for this |
-| | document |
-+----------------------------------+-------------------------------------------+
-| _rev (optional) | Document ID |
-+----------------------------------+-------------------------------------------+
-| _deleted (optional) | Update sequence number |
-+----------------------------------+-------------------------------------------+
-
-Inserting Documents in Bulk
----------------------------
-
-To insert documents in bulk into a database you need to supply a JSON
-structure with the array of documents that you want to add to the
-database. Using this method you can either include a document ID, or
-allow the document ID to be automatically generated.
-
-For example, the following inserts three new documents, two with the
-supplied document IDs, and one which will have a document ID generated:
-
-.. code-block:: javascript
-
- {
- "docs" : [
- {
- "_id" : "FishStew",
- "servings" : 4,
- "subtitle" : "Delicious with fresh bread",
- "title" : "Fish Stew"
- },
- {
- "_id" : "LambStew",
- "servings" : 6,
- "subtitle" : "Delicious with scone topping",
- "title" : "Lamb Stew"
- },
- {
- "servings" : 8,
- "subtitle" : "Delicious with suet dumplings",
- "title" : "Beef Stew"
- },
- ]
- }
-
-
-The return type from a bulk insertion will be 201, with the content of
-the returned structure indicating specific success or otherwise messages
-on a per-document basis.
-
-The return structure from the example above contains a list of the
-documents created, here with the combination and their revision IDs:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_bulk_docs
- Content-Type: application/json
-
- [
- {
- "id" : "FishStew",
- "rev" : "1-9c65296036141e575d32ba9c034dd3ee",
- },
- {
- "id" : "LambStew",
- "rev" : "1-34c318924a8f327223eed702ddfdc66d",
- },
- {
- "id" : "7f7638c86173eb440b8890839ff35433",
- "rev" : "1-857c7cbeb6c8dd1dd34a0c73e8da3c44",
- }
- ]
-
-
-The content and structure of the returned JSON will depend on the transaction
-semantics being used for the bulk update; see :ref:`api/db/bulk_docs/semantics`
-for more information. Conflicts and validation errors when updating documents in
-bulk must be handled separately; see :ref:`api/db/bulk_docs/validation`.
-
-Updating Documents in Bulk
---------------------------
-
-The bulk document update procedure is similar to the insertion
-procedure, except that you must specify the document ID and current
-revision for every document in the bulk update JSON string.
-
-For example, you could send the following request:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_bulk_docs
- Content-Type: application/json
-
- {
- "docs" : [
- {
- "_id" : "FishStew",
- "_rev" : "1-9c65296036141e575d32ba9c034dd3ee",
- "servings" : 4,
- "subtitle" : "Delicious with freshly baked bread",
- "title" : "Fish Stew"
- },
- {
- "_id" : "LambStew",
- "_rev" : "1-34c318924a8f327223eed702ddfdc66d",
- "servings" : 6,
- "subtitle" : "Serve with a wholemeal scone topping",
- "title" : "Lamb Stew"
- },
- {
- "_id" : "7f7638c86173eb440b8890839ff35433"
- "_rev" : "1-857c7cbeb6c8dd1dd34a0c73e8da3c44",
- "servings" : 8,
- "subtitle" : "Hand-made dumplings make a great accompaniment",
- "title" : "Beef Stew"
- }
- ]
- }
-
-The return structure is the JSON of the updated documents, with the new
-revision and ID information:
-
-.. code-block:: javascript
-
- [
- {
- "id" : "FishStew",
- "rev" : "2-e7af4c4e9981d960ecf78605d79b06d1"
- },
- {
- "id" : "LambStew",
- "rev" : "2-0786321986194c92dd3b57dfbfc741ce"
- },
- {
- "id" : "7f7638c86173eb440b8890839ff35433",
- "rev" : "2-bdd3bf3563bee516b96885a66c743f8e"
- }
- ]
-
-You can optionally delete documents during a bulk update by adding the
-``_deleted`` field with a value of ``true`` to each document ID/revision
-combination within the submitted JSON structure.
-
-The return type from a bulk insertion will be 201, with the content of
-the returned structure indicating specific success or otherwise messages
-on a per-document basis.
-
-The content and structure of the returned JSON will depend on the transaction
-semantics being used for the bulk update; see :ref:`api/db/bulk_docs/semantics`
-for more information. Conflicts and validation errors when updating documents in
-bulk must be handled separately; see :ref:`api/db/bulk_docs/validation`.
-
-.. _api/db/bulk_docs/semantics:
-
-Bulk Documents Transaction Semantics
-------------------------------------
-
-CouchDB supports two different modes for updating (or inserting)
-documents using the bulk documentation system. Each mode affects both
-the state of the documents in the event of system failure, and the level
-of conflict checking performed on each document. The two modes are:
-
-- ``non-atomic``
-
- The default mode is non-atomic, that is, CouchDB will only guarantee
- that some of the documents will be saved when you send the request.
- The response will contain the list of documents successfully inserted
- or updated during the process. In the event of a crash, some of the
- documents may have been successfully saved, and some will have been
- lost.
-
- In this mode, the response structure will indicate whether the
- document was updated by supplying the new ``_rev`` parameter
- indicating a new document revision was created. If the update failed,
- then you will get an ``error`` of type ``conflict``. For example:
-
- .. code-block:: javascript
-
- [
- {
- "id" : "FishStew",
- "error" : "conflict",
- "reason" : "Document update conflict."
- },
- {
- "id" : "LambStew",
- "error" : "conflict",
- "reason" : "Document update conflict."
- },
- {
- "id" : "7f7638c86173eb440b8890839ff35433",
- "error" : "conflict",
- "reason" : "Document update conflict."
- }
- ]
-
-
- In this case no new revision has been created and you will need to
- submit the document update, with the correct revision tag, to update
- the document.
-
-- ``all-or-nothing``
-
- In all-or-nothing mode, either all documents are written to the
- database, or no documents are written to the database, in the event
- of a system failure during commit.
-
- In addition, the per-document conflict checking is not performed.
- Instead a new revision of the document is created, even if the new
- revision is in conflict with the current revision in the database.
- The returned structure contains the list of documents with new
- revisions:
-
- .. code-block:: javascript
-
- [
- {
- "id" : "FishStew",
- "rev" : "2-e7af4c4e9981d960ecf78605d79b06d1"
- },
- {
- "id" : "LambStew",
- "rev" : "2-0786321986194c92dd3b57dfbfc741ce"
- },
- {
- "id" : "7f7638c86173eb440b8890839ff35433",
- "rev" : "2-bdd3bf3563bee516b96885a66c743f8e"
- }
- ]
-
- When updating documents using this mode the revision of a document
- included in views will be arbitrary. You can check the conflict
- status for a document by using the ``conflicts=true`` query argument
- when accessing the view. Conflicts should be handled individually to
- ensure the consistency of your database.
-
- To use this mode, you must include the ``all_or_nothing`` field (set
- to true) within the main body of the JSON of the request.
-
-The effects of different database operations on the different modes are
-summarized below:
-
-* **Transaction Mode**: ``Non-atomic``
-
- * **Transaction**: ``Insert``
-
- * **Cause**: Requested document ID already exists
- * **Resolution**: Resubmit with different document ID, or update the
- existing document
-
- * **Transaction**: ``Update``
-
- * **Cause**: Revision missing or incorrect
- * **Resolution**: Resubmit with correct revision
-
-* **Transaction Mode**: ``All-or-nothing``
-
- * **Transaction**: ``Insert`` / ``Update``
-
- * **Cause**: Additional revision inserted
- * **Resolution**: Resolve conflicted revisions
-
-Replication of documents is independent of the type of insert or update.
-The documents and revisions created during a bulk insert or update are
-replicated in the same way as any other document. This can mean that if
-you make use of the all-or-nothing mode the exact list of documents,
-revisions (and their conflict state) may or may not be replicated to
-other databases correctly.
-
-.. _api/db/bulk_docs/validation:
-
-Bulk Document Validation and Conflict Errors
---------------------------------------------
-
-The JSON returned by the ``_bulk_docs`` operation consists of an array
-of JSON structures, one for each document in the original submission.
-The returned JSON structure should be examined to ensure that all of the
-documents submitted in the original request were successfully added to
-the database.
-
-The exact structure of the returned information is:
-
-+----------------------------------+-------------------------------------------+
-| Field | Description |
-+==================================+===========================================+
-| docs [array] | Bulk Documents Document |
-+----------------------------------+-------------------------------------------+
-| id | Document ID |
-+----------------------------------+-------------------------------------------+
-| error | Error type |
-+----------------------------------+-------------------------------------------+
-| reason | Error string with extended reason |
-+----------------------------------+-------------------------------------------+
-
-When a document (or document revision) is not correctly committed to the
-database because of an error, you should check the ``error`` field to
-determine error type and course of action. Errors will be one of the
-following type:
-
-- ``conflict``
-
- The document as submitted is in conflict. If you used the default
- bulk transaction mode then the new revision will not have been
- created and you will need to re-submit the document to the database.
- If you used ``all-or-nothing`` mode then you will need to manually
- resolve the conflicted revisions of the document.
-
- Conflict resolution of documents added using the bulk docs interface
- is identical to the resolution procedures used when resolving
- conflict errors during replication.
-
-- ``forbidden``
-
- Entries with this error type indicate that the validation routine
- applied to the document during submission has returned an error.
-
- For example, if your validation routine includes the following:
-
- .. code-block:: javascript
-
- throw({forbidden: 'invalid recipe ingredient'});
-
- The error returned will be:
-
- .. code-block:: javascript
-
- {
- "id" : "7f7638c86173eb440b8890839ff35433",
- "error" : "forbidden",
- "reason" : "invalid recipe ingredient"
- }
-
-.. _api/db/temp_view:
-.. _api/db/temp_view.post:
-
-``POST /db/_temp_view``
-=======================
-
-* **Method**: ``POST /db/_temp_view``
-* **Request**: JSON with the temporary view definition
-* **Response**: Temporary view result set
-* **Admin Privileges Required**: yes
-
-Creates (and executes) a temporary view based on the view function
-supplied in the JSON request. For example:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_temp_view
- Content-Type: application/json
-
- {
- "map" : "function(doc) { if (doc.value > 9995) { emit(null, doc.value); } }"
- }
-
-The resulting JSON response is the result from the execution of the
-temporary view:
-
-.. code-block:: javascript
-
- {
- "total_rows" : 3,
- "rows" : [
- {
- "value" : 9998.41913029012,
- "id" : "05361cc6aa42033878acc1bacb1f39c2",
- "key" : null
- },
- {
- "value" : 9998.94149934853,
- "id" : "1f443f471e5929dd7b252417625ed170",
- "key" : null
- },
- {
- "value" : 9998.01511339154,
- "id" : "1f443f471e5929dd7b252417629c102b",
- "key" : null
- }
- ],
- "offset" : 0
- }
-
-The arguments also available to standard view requests also apply to
-temporary views, but the execution of the view may take some time as it
-relies on being executed at the time of the request. In addition to the
-time taken, they are also computationally very expensive to produce. You
-should use a defined view if you want to achieve the best performance.
-
-.. _api/db/purge:
-.. _api/db/purge.post:
-
-``POST /db/_purge``
-===================
-
-* **Method**: ``POST /db/_purge``
-* **Request**: JSON of the document IDs/revisions to be purged
-* **Response**: JSON structure with purged documents and purge sequence
-* **Admin Privileges Required**: no
-
-A database purge permanently removes the references to deleted documents
-from the database. Deleting a document within CouchDB does not actually
-remove the document from the database, instead, the document is marked as
-a deleted (and a new revision is created). This is to ensure that
-deleted documents are replicated to other databases as having been
-deleted. This also means that you can check the status of a document and
-identify that the document has been deleted.
-
-The purge operation removes the references to the deleted documents from
-the database. The purging of old documents is not replicated to other
-databases. If you are replicating between databases and have deleted a
-large number of documents you should run purge on each database.
-
-.. note::
-
- Purging documents does not remove the space used by them on disk. To
- reclaim disk space, you should run a database compact (see
- :ref:`api/db/compact`), and compact views (see :ref:`api/db/compact/ddoc`).
-
-To perform a purge operation you must send a request including the JSON
-of the document IDs that you want to purge. For example:
-
-.. code-block:: http
-
- POST http://couchdb:5984/recipes/_purge
- Content-Type: application/json
-
- {
- "FishStew" : [
- "17-b3eb5ac6fbaef4428d712e66483dcb79"
- ]
- }
-
-The format of the request must include the document ID and one or more
-revisions that must be purged.
-
-The response will contain the purge sequence number, and a list of the
-document IDs and revisions successfully purged.
-
-.. code-block:: javascript
-
- {
- "purged" : {
- "FishStew" : [
- "17-b3eb5ac6fbaef4428d712e66483dcb79"
- ]
- },
- "purge_seq" : 11
- }
-
-Updating Indexes
-----------------
-
-The number of purges on a database is tracked using a purge sequence.
-This is used by the view indexer to optimize the updating of views that
-contain the purged documents.
-
-When the indexer identifies that the purge sequence on a database has
-changed, it compares the purge sequence of the database with that stored
-in the view index. If the difference between the stored sequence and
-database is sequence is only 1, then the indexer uses a cached list of
-the most recently purged documents, and then removes these documents
-from the index individually. This prevents completely rebuilding the
-index from scratch.
-
-If the difference between the stored sequence number and current
-database sequence is greater than 1, then the view index is entirely
-rebuilt. This is an expensive operation as every document in the
-database must be examined.
-
-.. _api/db/all_docs:
-.. _api/db/all_docs.get:
-
-``GET /db/_all_docs``
-=====================
-
-* **Method**: ``GET /db/_all_docs``
-* **Request**: None
-* **Response**: JSON object containing document information, ordered by the
- document ID
-* **Admin Privileges Required**: no
-* **Query Arguments**:
-
- * **Argument**: descending
-
- * **Description**: Return the documents in descending by key order
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: false
-
- * **Argument**: endkey
-
- * **Description**: Stop returning records when the specified key is reached
- * **Optional**: yes
- * **Type**: string
-
- * **Argument**: endkey_docid
-
- * **Description**: Stop returning records when the specified document ID is
- reached
- * **Optional**: yes
- * **Type**: string
-
- * **Argument**: group
-
- * **Description**: Group the results using the reduce function to a group
- or single row
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: false
-
- * **Argument**: group_level
-
- * **Description**: Specify the group level to be used
- * **Optional**: yes
- * **Type**: numeric
-
- * **Argument**: include_docs
-
- * **Description**: Include the full content of the documents in the return
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: false
-
- * **Argument**: inclusive_end
-
- * **Description**: Specifies whether the specified end key should be
- included in the result
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: true
-
- * **Argument**: key
-
- * **Description**: Return only documents that match the specified key
- * **Optional**: yes
- * **Type**: string
-
- * **Argument**: limit
-
- * **Description**: Limit the number of the returned documents to the
- specified number
- * **Optional**: yes
- * **Type**: numeric
-
- * **Argument**: reduce
-
- * **Description**: Use the reduction function
- * **Optional**: yes
- * **Type**: boolean
- * **Default**: true
-
- * **Argument**: skip
-
- * **Description**: Skip this number of records before starting to return
- the results
- * **Optional**: yes
- * **Type**: numeric
- * **Default**: 0
-
- * **Argument**: stale
-
- * **Description**: Allow the results from a stale view to be used
- * **Optional**: yes
- * **Type**: string
- * **Default**:
- * **Supported Values**:
-
- * **ok**: Allow stale views
-
- * **Argument**: startkey
-
- * **Description**: Return records starting with the specified key
- * **Optional**: yes
- * **Type**: string
-
- * **Argument**: startkey_docid
-
- * **Description**: Return records starting with the specified document ID
- * **Optional**: yes
- * **Type**: string
-
-Returns a JSON structure of all of the documents in a given database.
-The information is returned as a JSON structure containing meta
-information about the return structure, and the list documents and basic
-contents, consisting the ID, revision and key. The key is generated from
-the document ID.
-
-+----------------------------------+-------------------------------------------+
-| Field | Description |
-+==================================+===========================================+
-| offset | Offset where the document list started |
-+----------------------------------+-------------------------------------------+
-| rows [array] | Array of document object |
-+----------------------------------+-------------------------------------------+
-| total_rows | Number of documents in the database/view |
-+----------------------------------+-------------------------------------------+
-| update_seq | Current update sequence for the database |
-+----------------------------------+-------------------------------------------+
-
-By default the information returned contains only the document ID and
-revision. For example, the request:
-
-.. code-block:: http
-
- GET http://couchdb:5984/recipes/_all_docs
- Accept: application/json
-
-Returns the following structure:
-
-.. code-block:: javascript
-
- {
- "total_rows" : 18386,
- "rows" : [
- {
- "value" : {
- "rev" : "1-bc0d5aed1e339b1cc1f29578f3220a45"
- },
- "id" : "Aberffrawcake",
- "key" : "Aberffrawcake"
- },
- {
- "value" : {
- "rev" : "3-68a20c89a5e70357c20148f8e82ca331"
- },
- "id" : "Adukiandorangecasserole-microwave",
- "key" : "Adukiandorangecasserole-microwave"
- },
- {
- "value" : {
- "rev" : "3-9b2851ed9b6f655cc4eb087808406c60"
- },
- "id" : "Aioli-garlicmayonnaise",
- "key" : "Aioli-garlicmayonnaise"
- },
- ...
- ],
- "offset" : 0
- }
-
-The information is returned in the form of a temporary view of all the
-database documents, with the returned key consisting of the ID of the
-document. The remainder of the interface is therefore identical to the
-View query arguments and their behavior.
-
-.. _api/db/all_docs.post:
-
-``POST /db/_all_docs``
-======================
-
-* **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
-:ref:`api/doc.get` requests.
-
-The request body should contain a list of the keys to be returned as an
-array to a ``keys`` object. For example:
-
-.. code-block:: http
-
- 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:
-
-.. code-block:: javascript
-
- {
- "total_rows" : 2666,
- "rows" : [
- {
- "value" : {
- "rev" : "1-a3544d296de19e6f5b932ea77d886942"
- },
- "id" : "Zingylemontart",
- "key" : "Zingylemontart"
- },
- {
- "value" : {
- "rev" : "1-91635098bfe7d40197a1b98d7ee085fc"
- },
- "id" : "Yogurtraita",
- "key" : "Yogurtraita"
- }
- ],
- "offset" : 0
- }
-
-.. _api/db/missing_revs:
-.. _api/db/missing_revs.post:
-
-``POST /db/_missing_revs``
-==========================
-
-* **Method**: ``POST /db/_missing_revs``
-* **Request**: JSON list of document revisions
-* **Response**: JSON of missing revisions
-* **Admin Privileges Required**: no
-
-.. _api/db/revs_diff:
-.. _api/db/revs_diff.post:
-
-``POST /db/_revs_diff``
-=======================
-
-* **Method**: ``POST /db/_revs_diff``
-* **Request**: JSON list of document revisions
-* **Response**: JSON list of differences from supplied document/revision list
-* **Admin Privileges Required**: no
-
-.. _api/db/security:
-.. _api/db/security.get:
-
-``GET /db/_security``
-=====================
-
-* **Method**: ``GET /db/_security``
-* **Request**: None
-* **Response**: JSON of the security object
-* **Admin Privileges Required**: no
-
-Gets the current security object from the specified database. The
-security object consists of two compulsory elements, ``admins`` and
-``readers``, which are used to specify the list of users and/or roles
-that have admin and reader rights to the database respectively. Any
-additional fields in the security object are optional. The entire
-security object is made available to validation and other internal
-functions so that the database can control and limit functionality.
-
-To get the existing security object you would send the following
-request:
-
-.. code-block:: javascript
-
- {
- "admins" : {
- "roles" : [],
- "names" : [
- "mc",
- "slp"
- ]
- },
- "readers" : {
- "roles" : [],
- "names" : [
- "tim",
- "brian"
- ]
- }
- }
-
-Security object structure is:
-
-* **admins**: Roles/Users with admin privileges
-
- * **roles** [array]: List of roles with parent privilege
- * **users** [array]: List of users with parent privilege
-
-* **readers**: Roles/Users with reader privileges
-
- * **roles** [array]: List of roles with parent privilege
- * **users** [array]: List of users with parent privilege
-
-.. note::
- If the security object for a database has never been set, then the
- value returned will be empty.
-
-.. _api/db/security.put:
-
-``PUT /db/_security``
-=====================
-
-* **Method**: ``PUT /db/_security``
-* **Request**: JSON specifying the admin and user security for the database
-* **Response**: JSON status message
-* **Admin Privileges Required**: no
-
-Sets the security object for the given database.For example, to set the
-security object for the ``recipes`` database:
-
-.. code-block:: javascript
-
- PUT http://couchdb:5984/recipes/_security
- Content-Type: application/json
-
- {
- "admins" : {
- "roles" : [],
- "names" : [
- "mc",
- "slp"
- ]
- },
- "readers" : {
- "roles" : [],
- "names" : [
- "tim",
- "brian"
- ]
- }
- }
-
-If the setting was successful, a JSON status object will be returned:
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-.. _api/db/revs_limit:
-.. _api/db/revs_limit.get:
-
-``GET /db/_revs_limit``
-=======================
-
-* **Method**: ``GET /db/_revs_limit``
-* **Request**: None
-* **Response**: The current revision limit setting
-* **Admin Privileges Required**: no
-
-
-Gets the current ``revs_limit`` (revision limit) setting.
-
-For example to get the current limit:
-
-.. code-block:: http
-
- GET http://couchdb:5984/recipes/_revs_limit
- Content-Type: application/json
-
-The returned information is the current setting as a numerical scalar:
-
-.. code-block:: javascript
-
- 1000
-
-.. _api/db/revs_limit.put:
-
-``PUT /db/_revs_limit``
-=======================
-
-* **Method**: ``PUT /db/_revs_limit``
-* **Request**: A scalar integer of the revision limit setting
-* **Response**: Confirmation of setting of the revision limit
-* **Admin Privileges Required**: no
-
-Sets the maximum number of document revisions that will be tracked by
-CouchDB, even after compaction has occurred. You can set the revision
-limit on a database by using ``PUT`` with a scalar integer of the limit
-that you want to set as the request body.
-
-For example to set the revs limit to 100 for the ``recipes`` database:
-
-.. code-block:: http
-
- PUT http://couchdb:5984/recipes/_revs_limit
- Content-Type: application/json
-
- 100
-
-If the setting was successful, a JSON status object will be returned:
-
-.. code-block:: javascript
-
- {
- "ok" : true
- }
-
-.. _JSON object: #table-couchdb-api-db_db-json-changes