From user-return-9809-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Apr 07 10:26:24 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 72198 invoked from network); 7 Apr 2010 10:26:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Apr 2010 10:26:24 -0000 Received: (qmail 65228 invoked by uid 500); 7 Apr 2010 10:26:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 65123 invoked by uid 500); 7 Apr 2010 10:26:23 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 65114 invoked by uid 99); 7 Apr 2010 10:26:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 10:26:22 +0000 X-ASF-Spam-Status: No, hits=-0.8 required=10.0 tests=AWL,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.244.253.218] (HELO mail.traeumt.net) (80.244.253.218) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 10:26:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.traeumt.net (Postfix) with ESMTP id 4EB691B4F3 for ; Wed, 7 Apr 2010 12:25:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.g3th.net Received: from unknown by localhost (amavisd-new, unix socket) id 9l53s+KCPZnT for ; Wed, 7 Apr 2010 12:25:53 +0200 (CEST) Received: from [10.0.1.14] (62-220-4-154.berlikomm.net [62.220.4.154]) (authenticated) by mail.traeumt.net (amavisd-milter) (authenticated as web50m1); Wed, 7 Apr 2010 12:25:53 +0200 (CEST) (envelope-from ) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Apple Message framework v1078) Subject: Re: delete Docs From: Jan Lehnardt In-Reply-To: Date: Wed, 7 Apr 2010 12:25:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <56AC852E-09C3-4B8B-899D-66B5BCE4F3BB@me.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1078) On 7 Apr 2010, at 07:53, wolfgang haefelinger wrote: > I would like to disagree .. >=20 > 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 ): >=20 > $ curl -X DELETE http://localhost:5984/mydb/myid?rev=3Dwhatever 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 -- >=20 >=20 >=20 > On Tue, Apr 6, 2010 at 4:22 PM, Noah Slater wrote: >>=20 >> On 6 Apr 2010, at 15:15, Jan Lehnardt wrote: >>=20 >>>=20 >>> On 6 Apr 2010, at 09:53, wolfgang haefelinger wrote: >>>>> and indeed couchdb-python uses this : >>>>>=20 >>>>> status, headers, data =3D self.resource.head(id) >>>>> self.resource.delete_json(id, = rev=3Dheaders['etag'].strip('"')) >>>>=20 >>>> Strange. Wouldn't we expect that deleting a resource is independent >>>> from its representation, would we? >>>=20 >>> No we wouldn't :) =97 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 :) >>=20 >> 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. >=20 >=20 >=20 > --=20 > Wolfgang H=E4felinger > h=E4felinger IT - Applied Software Architecture > http://www.haefelinger.it > +31 648 27 61 59