diff options
author | jiahuili <lijiahui702@gmail.com> | 2023-04-07 11:24:18 -0500 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2023-04-10 12:21:06 -0400 |
commit | 1432717b154e2986e86da18c78ca843e020a5bfd (patch) | |
tree | c3569d617e97a57cee0f2506f269ba8aa63cc63e | |
parent | db38da4af505ffb8b28f3dab0584750d99a48daa (diff) | |
download | couchdb-1432717b154e2986e86da18c78ca843e020a5bfd.tar.gz |
docs: Fixed `_compact/{ddoc}` and `_shards/{docid}` examples
- Modified the example and add a `manual view compaction` link to the
api `/{db}/_compact/{ddoc}` to facilitate users to view `_compact`
related documents.
- Fixed example request for GET /{db}/_shards/{docid}
-rw-r--r-- | src/docs/src/api/database/compact.rst | 4 | ||||
-rw-r--r-- | src/docs/src/api/database/shard.rst | 9 | ||||
-rw-r--r-- | src/docs/src/maintenance/compaction.rst | 19 |
3 files changed, 22 insertions, 10 deletions
diff --git a/src/docs/src/api/database/compact.rst b/src/docs/src/api/database/compact.rst index 8d81d5023..ecd82b930 100644 --- a/src/docs/src/api/database/compact.rst +++ b/src/docs/src/api/database/compact.rst @@ -94,7 +94,7 @@ It may be that compacting a large view can return more storage than compacting the actual db. Thus, 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. + affected by a recent database change. See :ref:`compact/views` for details. :param db: Database name :param ddoc: Design document name @@ -114,7 +114,7 @@ .. code-block:: http - POST /db/_compact/posts HTTP/1.1 + POST /db/_compact/ddoc HTTP/1.1 Accept: application/json Content-Type: application/json Host: localhost:5984 diff --git a/src/docs/src/api/database/shard.rst b/src/docs/src/api/database/shard.rst index 1b923240d..b9c196608 100644 --- a/src/docs/src/api/database/shard.rst +++ b/src/docs/src/api/database/shard.rst @@ -132,12 +132,9 @@ .. code-block:: http - HTTP/1.1 200 OK - Cache-Control: must-revalidate - Content-Length: 94 - Content-Type: application/json - Date: Fri, 18 Jan 2019 20:08:07 GMT - Server: CouchDB/2.3.0-9d4cb03c2 (Erlang OTP/19) + GET /db/_shards/docid HTTP/1.1 + Accept: */* + Host: localhost:5984 **Response**: diff --git a/src/docs/src/maintenance/compaction.rst b/src/docs/src/maintenance/compaction.rst index 6f8b44349..de44cc4f7 100644 --- a/src/docs/src/maintenance/compaction.rst +++ b/src/docs/src/maintenance/compaction.rst @@ -334,9 +334,24 @@ Manual View Compaction Views also need compaction. Unlike databases, views are compacted by groups per `design document`. To start their compaction, send the HTTP -:post:`/{db}/_compact/{ddoc}` request:: +:post:`/{db}/_compact/{ddoc}` request: - curl -H "Content-Type: application/json" -X POST http://localhost:5984/dbname/_compact/designname +**Design Document**: + +.. code-block:: json + + { + "_id": "_design/ddoc-name", + "views": { + "view-name": { + "map": "function(doc) { emit(doc.key, doc.value) }" + } + } + } + +.. code-block:: bash + + curl -H "Content-Type: application/json" -X POST http://localhost:5984/dbname/_compact/ddoc-name .. code-block:: javascript |