DELETE /{db}/{doc}

In this document

This request deletes a document from the database. When a document is deleted, the revision number is updated so the database can track the deletion in synchronized copies.

Request


Request headers

Query parameters

NameTypeDescriptionDefault
batch stringStores the document in batch mode. To use, set the value to ok.none
rev stringRevision identifiernone

Message body

None

Response


Status codes

Response headers

Message body

The response is a JSON document that contains the following objects:

NameTypeDescription
id StringDocument identifier
ok BooleanIndicates whether the operation was successful
rev Stringrevision identifier

Example


Request

DELETE /cookbook/ButterChicken?rev=2-1b76d07281d4a576130c7d8f9f621d5e HTTP/1.1
Host: localhost:59840

Response

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: application/json
Date: Fri, 13 Dec 2013 20:52:38 GMT
Etag: "3-7c9a006fb9938b0994cb06a9c11521e7"
Server: CouchbaseLite 1.486
Transfer-Encoding: chunked
{
  "id" : "ButterChicken",
  "rev" : "3-7c9a006fb9938b0994cb06a9c11521e7",
  "ok" : true
}