couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wolfgang haefelinger <whaefelin...@gmail.com>
Subject Re: delete Docs
Date Wed, 07 Apr 2010 05:53:20 GMT
I would like to disagree ..

My remark was about why one needs to know the representation (here
Javascript) 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



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