1.7. Local (non-replicating) Documents
Local documents have the following limitations:
- Local documents are not replicated to other databases.
- Local documents are not output by views, or the /{db}/_all_docs view.
From CouchDB 2.0, Local documents can be listed by using the /db/_local_docs endpoint.
Local documents can be used when you want to store configuration or other information for the current (local) instance of a given database.
A list of the available methods and URL paths are provided below:
GET
/{db}/_local_docs
Returns a JSON structure of all of the local documents in a given database. The information is returned as a JSON structure containing meta information about the return structure, including a list of all local documents and basic contents, consisting the ID, revision and key. The key is the from the local document’s _id
.
Parameters: |
|
---|---|
Request Headers: | |
| |
Query Parameters: | |
| |
Response Headers: | |
| |
Response JSON Object: | |
| |
Status Codes: |
Response:
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.
Request:
The returned JSON is the all documents structure, but with only the selected keys in the output:
1.7.2. /db/_local/id
GET
/{db}/_local/{docid}
PUT
/{db}/_local/{docid}
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated. See PUT /{db}/{docid}.
DELETE
/{db}/_local/{docid}
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated. See .
COPY
/{db}/_local/{docid}
Copies the specified local document. The semantics are identical to copying a standard document in the specified database, except that the document is not replicated. See COPY /{db}/{docid}.