couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: delete Docs
Date Wed, 07 Apr 2010 10:25:54 GMT

On 7 Apr 2010, at 07:53, wolfgang haefelinger wrote:

> I would like to disagree ..
> 
> My remark was about why one needs to know the representation (here
> Javascript)

You mean JSON? :)

> of the resource in order to delete it. After all, the
> following appears to work fine (still using version 0.10 ):
> 
> $ curl -X DELETE http://localhost:5984/mydb/myid?rev=whatever

You are saying are are able to delete a document by passing in a rev that doesn't match the
rev in the document? Can you create a reproducing test case for that?

Cheers
Jan
--


> 
> 
> 
> On Tue, Apr 6, 2010 at 4:22 PM, Noah Slater <nslater@me.com> wrote:
>> 
>> On 6 Apr 2010, at 15:15, Jan Lehnardt wrote:
>> 
>>> 
>>> On 6 Apr 2010, at 09:53, wolfgang haefelinger wrote:
>>>>> and indeed couchdb-python uses this :
>>>>> 
>>>>>       status, headers, data = self.resource.head(id)
>>>>>       self.resource.delete_json(id, rev=headers['etag'].strip('"'))
>>>> 
>>>> Strange. Wouldn't we expect that deleting a resource is independent
>>>> from its representation, would we?
>>> 
>>> No we wouldn't :) — When writing, you need to prove that you don't
>>> accidentally overwrite anybody else's data. This is not a REST but
>>> a CouchDB constraint, but it doesn't violate REST really. Also,
>>> deleting data is bad, mmkay :)
>> 
>> The distinction here is that you're not deleting the resource at all, you are deleting
the representation. So CouchDB asks you to demonstrate that you know which version of the
representation you're wanting to delete. It's a core part of CouchDB's conflict protection
mechanism.
> 
> 
> 
> -- 
> Wolfgang Häfelinger
> häfelinger IT - Applied Software Architecture
> http://www.haefelinger.it
> +31 648 27 61 59


Mime
View raw message