From user-return-16467-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Jun 2 17:06:27 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3B4C4B81 for ; Thu, 2 Jun 2011 17:06:26 +0000 (UTC) Received: (qmail 58826 invoked by uid 500); 2 Jun 2011 17:06:25 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58785 invoked by uid 500); 2 Jun 2011 17:06:25 -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 58777 invoked by uid 99); 2 Jun 2011 17:06:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 17:06:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nebupookins@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 17:06:17 +0000 Received: by vxk12 with SMTP id 12so1198565vxk.11 for ; Thu, 02 Jun 2011 10:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:references:from:content-type:x-mailer :in-reply-to:message-id:date:to:content-transfer-encoding :mime-version; bh=lSLgQRuxKwwhKhaaXn0cs+tYtY9nkX2DqGnXJpcpVkM=; b=Ysa1VHFQt5fqeZv+ufFkXkhjah4y7T3IWtXrWrOQkvp5Pytm1TPlqx76/jNaInKNmi Wk4fjKh+fTt5/4ycy31dMGQbHQIuWojcJItjwFtZq1qXNU/SJT7GFGcCVrT/GkCusfY2 UARgoDe2v16WXDlChM9AWclkwHHxRIJnzMZWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; b=uYQfqB9CvFXmngkyVe10Md3MFyfGBe2z2RKYclfVH4oyptpb/sMBeWfqIwKUwxG6df GBsJHT1JXm90CVsEwk9Foycmm5SJlvKm7hw1C5CEWwj1F25Bxoc7ZfUgLbTdw7QkK7IW qQvjte/0F9wdOcjAWTzWdkD+DKBDIHOtO4oUY= Received: by 10.52.110.234 with SMTP id id10mr1268651vdb.303.1307034355928; Thu, 02 Jun 2011 10:05:55 -0700 (PDT) Received: from [192.168.2.10] (bas1-montreal43-2925384707.dsl.bell.ca [174.93.212.3]) by mx.google.com with ESMTPS id dv4sm296815vbb.0.2011.06.02.10.05.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2011 10:05:55 -0700 (PDT) Subject: Re: Updates References: From: Nebu Pookins Content-Type: text/plain; charset=us-ascii X-Mailer: iPad Mail (8J3) In-Reply-To: Message-Id: Date: Thu, 2 Jun 2011 13:05:57 -0400 To: "user@couchdb.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (iPad Mail 8J3) X-Virus-Checked: Checked by ClamAV on apache.org CouchDB differs from those other databases in that the other databases allow= you to update a single field, rather than clobber the whole row. E.g. In SQ= L, you'd write something like "update field1 =3D 35 where I'd =3D 17" and if= somebody had modified field2 in the interim, your query wouldn't undo their= change. In contrast, with couchDB, you're PUTting the whole document, which= *would* undo their change, hence the need for specifying the revision.=20 Sent from my iPad On 2011-06-01, at 12:46 PM, Daniele Testa wrote: > Shouldn't that be up to the user? Why would the database protect me from t= hat. >=20 > You would have the same "problem" in all databases. If I edit a page > in a CMS and in the meantime that I change the things in the form, > some other user might have edit that same page. >=20 > I don't see the problem why the user cannot specify something like > "_rev=3Dlatest". >=20 > Personally, I find it very cumbersome to have to do a GET every time I > need to do a PUT. It also makes the update slower, as I need to do 2 > requests (sometimes over slow connections). >=20 > Regards, > Daniele >=20 >=20 > 2011/6/1 Robert Newson : >> We can't assume that, the document may have already changed between >> you reading it and updating it. >>=20 >> http://guide.couchdb.org/editions/1/en/consistency.html >>=20 >> B. >>=20 >> On 1 June 2011 17:35, Daniele Testa wrote: >>> Hi, >>>=20 >>> I am new to this mailing list so please forgive me if this is a stupid q= uestion. >>>=20 >>> Why do I have to specify a revisionID when I do an update? >>> Can't couchdb just assume I meant to update the last revision if I >>> leave the revisionID empty? >>>=20 >>> If I know that I want to update document with id=3DXYZ, do I have to >>> first do a GET/HEAD for that id to get the >>> last revision ID, and then run the PUT? >>>=20 >>> I really hope there is a better way :) >>>=20 >>> Regards, >>> Daniele >>>=20 >>=20