incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Slater <nsla...@me.com>
Subject Re: delete Docs
Date Tue, 06 Apr 2010 14:22:36 GMT

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.
Mime
View raw message