Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 21230 invoked from network); 7 Apr 2010 05:53:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Apr 2010 05:53:49 -0000 Received: (qmail 18120 invoked by uid 500); 7 Apr 2010 05:53:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18037 invoked by uid 500); 7 Apr 2010 05:53:47 -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 18014 invoked by uid 99); 7 Apr 2010 05:53:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 05:53:47 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of whaefelinger@gmail.com designates 209.85.218.221 as permitted sender) Received: from [209.85.218.221] (HELO mail-bw0-f221.google.com) (209.85.218.221) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 05:53:41 +0000 Received: by bwz21 with SMTP id 21so508252bwz.35 for ; Tue, 06 Apr 2010 22:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=l0HTEBu4JlQxYxZuXkel36YRDtEh7JyM4wG/RP/yoXM=; b=rHS8qGOKRtsOtoW8kDCKEgx4t924bTs1Gu0R2XF3w6wtyO8Gqu6kt8W6/yHqBuJ0zh EInrmu2Nuc6qXDs4GR5dY8ny29bSsgNZP3LNjjaEoNxdNmqF6l2zchMxs5FPaWYPIGR+ QAYPAZrNq5y3833GfpgG5RnkrfCcOS9/VSHy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IfKsU0K9NRDA5Vv0enwogVVypdR2VtZWFZ3dqqz/GyAKFQ613w/xmq0RCbpU/cCKIQ 4RN9QUgNbCvQgMkiVkHl5EwtmqXQ1EQcFUtw/PNWTfvlayie7owgRlxULPmLPo1L9cli 9pCRYv/Mjxax8cdmXn/TdkuV78yE9iw+/ZsW0= MIME-Version: 1.0 Received: by 10.204.121.197 with HTTP; Tue, 6 Apr 2010 22:53:20 -0700 (PDT) In-Reply-To: <56AC852E-09C3-4B8B-899D-66B5BCE4F3BB@me.com> References: <56AC852E-09C3-4B8B-899D-66B5BCE4F3BB@me.com> Date: Wed, 7 Apr 2010 07:53:20 +0200 Received: by 10.204.163.65 with SMTP id z1mr8868331bkx.65.1270619600169; Tue, 06 Apr 2010 22:53:20 -0700 (PDT) Message-ID: Subject: Re: delete Docs From: wolfgang haefelinger To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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=3Dwhatever On Tue, Apr 6, 2010 at 4:22 PM, Noah Slater 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 : >>>> >>>> =A0 =A0 =A0 status, headers, data =3D self.resource.head(id) >>>> =A0 =A0 =A0 self.resource.delete_json(id, rev=3Dheaders['etag'].strip(= '"')) >>> >>> Strange. Wouldn't we expect that deleting a resource is independent >>> from its representation, would we? >> >> 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 :) > > 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 y= ou know which version of the representation you're wanting to delete. It's = a core part of CouchDB's conflict protection mechanism. --=20 Wolfgang H=E4felinger h=E4felinger IT - Applied Software Architecture http://www.haefelinger.it +31 648 27 61 59