Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26099 invoked from network); 5 Apr 2011 23:13:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2011 23:13:18 -0000 Received: (qmail 93056 invoked by uid 500); 5 Apr 2011 23:13:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 93019 invoked by uid 500); 5 Apr 2011 23:13:17 -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 93011 invoked by uid 99); 5 Apr 2011 23:13:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 23:13:17 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,HK_RANDOM_ENVFROM,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dbfclark@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; Tue, 05 Apr 2011 23:13:07 +0000 Received: by vxk12 with SMTP id 12so1098822vxk.11 for ; Tue, 05 Apr 2011 16:12:46 -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=H0AdKVZToDsUo1E3hk3YXCy+lw2LESyQTDOwBmPNxX0=; b=ef+OISSnAZHRCDDwt8QFHFGlvo0AVFxYGbxEABelUEsfFnWW//mMK7xBWYDpydBmzD AD4IjX5YO0IoFMfZjWrXT0tPiBoDGe0pjyFgmidHBm/cVAfIdWRrBQe6r7z9Evob21LG 3zA5xCtuvMTBnCbvmuzPfDor/IWHA94hx0FV0= 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=j9yhQiVAutR5YEx+lBesx1hDpGYNUMWRqdEBOufpfOdvXqf1GZuksesF0Agq/+MGeA ZdGqs+W4zL2fLTWZ/f5owZ6HdewBuB7vwPOpqQ7SHQPdunPR2sozwhHIIvP10I5xDZbl 09cEZ40MG0oO5TXJbLzUKxuYIzWBoegGAxwLY= Received: by 10.52.93.2 with SMTP id cq2mr460501vdb.49.1302045166368; Tue, 05 Apr 2011 16:12:46 -0700 (PDT) Received: from [10.0.1.3] (cpe-66-108-208-203.nyc.res.rr.com [66.108.208.203]) by mx.google.com with ESMTPS id x29sm1569045vcf.2.2011.04.05.16.12.44 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2011 16:12:45 -0700 (PDT) Subject: Re: Update conflicts? References: <087E6783-3D4C-4B44-AA9E-A3F7A8283964@gmail.com> From: Dennis Clark Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (8F190) In-Reply-To: Message-Id: <87AB3758-87B3-4766-927B-4FB69724E742@gmail.com> Date: Tue, 5 Apr 2011 19:12:40 -0400 To: "user@couchdb.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (iPhone Mail 8F190) X-Virus-Checked: Checked by ClamAV on apache.org What's your actual function? Update functions should work fine for your use c= ase, but can be a little finicky to get working, particularly the first time= . On Apr 5, 2011, at 7:01 PM, Luis Miguel Silva wrote: > Thank you! I'll probably have to evaluate it then... >=20 > I've looked at the update handlers but i can't get them to work :o\... > I'm creating a _design document with a "updates" field with an update > function inside but i can't seem to get it to work. >=20 > Either way, i think it's time i evaluate MongoDB :o((... (this was > unexpected, i was completely sold on CouchDB :o|). >=20 > On Tue, Apr 5, 2011 at 4:50 PM, Sean Copenhaver > wrote: >> Ah, the problem is that couchdb does not do partial updates. It writes th= e whole doc. MongoDB I believe does support partial updates though. No exper= ience with it. >>=20 >>=20 >>=20 >> On Apr 5, 2011, at 6:41 PM, Luis Miguel Silva wrote: >>=20 >>> More or less! >>>=20 >>> The most common scenario will be: >>> - two or more processes writing to the same document, but only to a >>> specific attribute (not overwriting the whole document) >>>=20 >>> If, by any chance, two processes overwrite the same field, i'm ok with >>> the last one always winning. >>>=20 >>> Thanks, >>> Luis >>>=20 >>> On Tue, Apr 5, 2011 at 4:26 PM, Robert Newson w= rote: >>>> "Ideally, we would be able to update without specifying the _rev, just >>>> posting (or, in this case PUTting) to the document..." >>>>=20 >>>> So you want to blindly overwrite some unknown data? >>>>=20 >>>> B. >>>>=20 >>>> On 5 April 2011 22:57, Zachary Zolton wrote:= >>>>> Luis, >>>>>=20 >>>>> Checkout _update handlers: >>>>>=20 >>>>> http://wiki.apache.org/couchdb/Document_Update_Handlers >>>>>=20 >>>>>=20 >>>>> Cheers, >>>>>=20 >>>>> Zach >>>>>=20 >>>>> On Tue, Apr 5, 2011 at 4:46 PM, Luis Miguel Silva >>>>> wrote: >>>>>> Dear all, >>>>>>=20 >>>>>> I'm trying to play around with updates and i'm bumping into some prob= lems. >>>>>>=20 >>>>>> Let's image we have to clients that poll a document from the server a= t >>>>>> the same time and get the same _rev. >>>>>> Then one of them updates the doc based on the _rev it got: >>>>>> [root@xkitten ~]# curl -X PUT -d >>>>>> '{"_rev":"3-0d519bcf08130bf784f3c35d79760740","hello2":"fred2"}' >>>>>> http://localhost:5984/benchmark/test?conflicts=3Dtrue >>>>>> {"ok":true,"id":"test","rev":"4-03640ebafbb4fcaf127844671f8e2de7"} >>>>>> Then another one tries to update the doc based on the same exact _rev= : >>>>>> [root@xkitten ~]# curl -X PUT -d >>>>>> '{"_rev":"3-0d519bcf08130bf784f3c35d79760740","hello3":"fred3"}' >>>>>> http://localhost:5984/benchmark/test?conflicts=3Dtrue >>>>>> {"error":"conflict","reason":"Document update conflict."} >>>>>> [root@xkitten ~]# >>>>>>=20 >>>>>> Is there a way to avoid this?! (like...make the update just create a >>>>>> new _rev or something)?? >>>>>>=20 >>>>>> Ideally, we would be able to update without specifying the _rev, just= >>>>>> posting (or, in this case PUTting) to the document... >>>>>>=20 >>>>>> Thoughts?? >>>>>>=20 >>>>>> Thank you, >>>>>> Luis >>>>>>=20 >>>>>=20 >>>>=20 >>=20