POST /{db}/_purge

In this document

This request permanently removes references to specified deleted documents from the database.

Deleting a document does not remove the document from the database. It just marks the document as deleted and creates a new revision to ensure that deleted documents can be replicated to other databases as having been deleted. This also means that you can check the status of a document and determine whether the document has been deleted by its absence.

Purging documents does not remove the space used by them on disk. To reclaim disk space, run a database compact (see /db/_compact) or compact views (see /db/_compact/design-doc) request.

Caution:

Avoid using POST/db/_purge requests because they can have unanticipated side effects.

Request


Request headers

This request does not have any required headers.

Query parameters

This request does not use query parameters.

Message body

The request message body is a JSON document that contains an object in which the key is a document identifier and the value is a list of the revision identifiers.

NameTypeDescription
not applicableobjectAn object that represents the document to be purged. The key is the document identifier and the value is an array that contains identifiers of the revisions to be purged.

Response


Status codes

Response headers

This response uses only standard HTTP headers.

Message body

The response message body contains the following objects:

NameTypeDescription
purge_seqintegerPurge sequence number
purgedobjectAn object that represents the purged document. The key is the document identifier and the value is an array that contains identifiers of the purged revisions.

Example


Request

POST /cookbook/_purge HTTP/1.1

Response