From couchdb-user-return-1860-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Fri Nov 14 02:22:04 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 93395 invoked from network); 14 Nov 2008 02:22:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Nov 2008 02:22:04 -0000 Received: (qmail 51151 invoked by uid 500); 14 Nov 2008 02:22:11 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 50794 invoked by uid 500); 14 Nov 2008 02:22:10 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 50783 invoked by uid 99); 14 Nov 2008 02:22:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 18:22:10 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of antony.blakey@gmail.com designates 209.85.198.249 as permitted sender) Received: from [209.85.198.249] (HELO rv-out-0708.google.com) (209.85.198.249) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 02:20:49 +0000 Received: by rv-out-0708.google.com with SMTP id k29so1375500rvb.0 for ; Thu, 13 Nov 2008 18:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=2azY7d0gXm7KJIG6yE3VSzv+LTIX20C0zaVGCq+4AQc=; b=pT/CrzFttzo+CZMUfBdF6z1tTGiGH0W+CVz2AwS5/1+eZoHAzmB/uOAofFHmiuRXfU jgddlrqSCu/f+ddNFOBMQZV1oRM897QPtW/zbgbC0NXcmOiC/sAt2jnoRkwwDADxAati eA1LEhc6AWN/t/cAMotRRV3rg9xajac90j8B0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=x+0fS8iCHJ/5ffgf6KtPxECt+WQnN6rJufeYVTIGtZ/uUpb8XWCaJzM1X8uwcOYXGx Og7UTdgkTwxY5Qfaxbn5FvKQGQ3vLnNaKBJOP8YRU7JRLxjLU63yK/w6lbWOCP3K32EA f/tjRYSQEDOawxiffSGOyHUAbDQCxTBt5YnrI= Received: by 10.140.248.15 with SMTP id v15mr217924rvh.295.1226629282876; Thu, 13 Nov 2008 18:21:22 -0800 (PST) Received: from ?192.168.0.16? (ppp121-45-41-103.lns10.adl2.internode.on.net [121.45.41.103]) by mx.google.com with ESMTPS id k41sm278152rvb.4.2008.11.13.18.21.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 Nov 2008 18:21:22 -0800 (PST) Message-Id: From: Antony Blakey To: couchdb-user@incubator.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Document Updates Date: Fri, 14 Nov 2008 12:51:17 +1030 References: <403828.36717.qm@web52508.mail.re2.yahoo.com> <46837.75533.qm@web52503.mail.re2.yahoo.com> <20081113163808.GA15315@tumbolia.org> <27d8d0930811130840t47269d91o9539fae200bcd380@mail.gmail.com> <20081113164344.GB15315@tumbolia.org> <99294D7F-4D06-47F9-800B-DB9213D929F4@gmail.com> <20081113220313.GG15315@tumbolia.org> <20081113233718.GI15315@tumbolia.org> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On 14/11/2008, at 12:32 PM, Antony Blakey wrote: > { > "docs": [ > /* Just for backwards compatibility ... but does that matter for > an alpha product ? */ > ... as now ... > ], > > "PUT": [ > /* As now with docs, but not allowing "delete":true ? */ > { "_id": ..., "_rev": ..., ... } > ... > ], > "PATCH": [ > { "_id": ..., "_rev": ..., deltas: [ { "replace":... }, ... ] } > ... > ], > "DELETE": [ > { "_id": ..., "_rev": ... }, > ... > ] > } > > This has the benefit of (roughly) representing the HTTP methods that > it aggregates. On second thought, given that it represents an aggregation of commands that have an explicit ordering, maybe it shouldn't be grouped by method but instead use the method as a key. Like this: [ { "delete":{ "_id": ..., "_rev": ... } }, { "put": { "_id": ..., "_rev": ..., ... }, { "patch": { "_id": ..., "_rev": ... } "with": [ { "replace": ... "with": ... }, ... ] }, ... ] The benefit of this that generating this is easier to reason about and generate if your client code is doing deletes and inserts of documents with the same id. It accurately represents adding a transactional boundary without requiring a change in semantics. Antony Blakey ------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 When I hear somebody sigh, 'Life is hard,' I am always tempted to ask, 'Compared to what?' -- Sydney Harris