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 13:29:49 GMT
On 19 October 2010 12:35, Alex Ivasyuv <industral@gmail.com> wrote:
> Thanks Matt for reply, but question still exist, is there some way to delete
> doc in ONE request without mentioned revision. In your example I need to
> make a GET request first.

It's not possible in 1 request. As I said, you must provide the current _rev.

- Matt

>
> Thanks,
>
> Sent from my HTC
>
> ----- Reply message -----
> From: "Matt Goodall" <matt.goodall@gmail.com>
> Date: Tue, Oct 19, 2010 2:04 pm
> Subject: DELETE doc without rev
> To: <user@couchdb.apache.org>
>
> 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