couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <matt.good...@gmail.com>
Subject Re: DELETE doc without rev
Date Tue, 19 Oct 2010 11:04:30 GMT
On 19 October 2010 11:39, Alex Ivasyuv <industral@gmail.com> wrote:
> Hi,
>
> I would like to delete a document from DB. But for this purpose I need to
> explicitly mentioned a version, what's assume, to get
> one more call for get it.
> Is there any way to delete doc without mentioned revision of doc, e.g.
>
> $ curl -X DELETE http://localhost:5984/mydb/mydoc-123

You must provide the current _rev to delete a document. However, you
can get the doc's current rev from the ETag in a HEAD response.

$ curl http://localhost:5984/mydb/mydoc-123 -I
HTTP/1.1 200 OK
Server: CouchDB/1.0.1 (Erlang OTP/R13B)
Etag: "3-825cb35de44c433bfb2df415563a19de"
Date: Tue, 19 Oct 2010 11:00:41 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 64
Cache-Control: must-revalidate

- Matt

Mime
View raw message