Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 76436 invoked from network); 30 Dec 2009 01:51:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Dec 2009 01:51:20 -0000 Received: (qmail 36270 invoked by uid 500); 30 Dec 2009 01:51:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36193 invoked by uid 500); 30 Dec 2009 01:51:19 -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 36183 invoked by uid 99); 30 Dec 2009 01:51:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2009 01:51:19 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.222.182 as permitted sender) Received: from [209.85.222.182] (HELO mail-pz0-f182.google.com) (209.85.222.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2009 01:51:09 +0000 Received: by pzk12 with SMTP id 12so1131707pzk.13 for ; Tue, 29 Dec 2009 17:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=JL3lf6sS0rHRRBfX2idB0dw+qUOGYvuc/XvjMgCHxLc=; b=FutHqnat1T+ypda0RPWS43OeW4bBi7rMYcol4S8TgnX3WzX6qK6OTlCNQlgBBGFgE+ UF3Doie0hSLRGn1dgV1ixyk/BvpPeoIZMClb/qwCWVT17UEHsAkSYm0UXxEXyuGN1Ipo stl+9d0vNufDHsAEdu3vDOBQiV1kTVevjdAOA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZJq0FZ3wnvAPs2IeZXi4KxP0+MIq6uQU12/y/OHK+vai701fdmHtn1PDRZ2PkpA0uX 9rN9aY8WJlZIOeO8H11RABYq1TdSxbiY8Cj8vxTt2MKLjHCUv5tDBBuCFvLYgAKTvY6W rPkNN1sf25OV4qCqgjF6zz+glbdUDvpcLZkHQ= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.142.202.21 with SMTP id z21mr4736700wff.235.1262137849029; Tue, 29 Dec 2009 17:50:49 -0800 (PST) In-Reply-To: References: <6ebae6780912271244p3bbb4648t301fe0f85dbd6519@mail.gmail.com> Date: Tue, 29 Dec 2009 17:50:49 -0800 X-Google-Sender-Auth: c1773749c2025445 Message-ID: Subject: Re: atomic/concurrent update_seq for _changes From: Chris Anderson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 29, 2009 at 5:33 PM, Joscha Feth wrote: > Joscha Feth wrote: > >> I am doing exactly the same in my application and the gap between #1 >> and #2 also worried me - a special header sounds like a feasible >> solution and I can't see any downside besides the few bytes of >> overhead in the header for each request. > > > Just for the record: you can create a custom list/show function, which > adds the header: > > "lists": { > mylist : "function(head, req) { start({\"code\": 200, \"headers\": > {\"X-Update-Seq\": (\"\"+req.info.update_seq)}}); send(\"whatever\"); }" > } > > One comment: you need to convert the update_seq into a string before > sending it back via start() - might be a bug. > I think a fine way to add this information would be in the JSON view response body itself, something like: {"total_rows":1000,"offset":0, "update_seq": 1001, "rows":[ {"id":"1","key":1,"value":null}, ... This patch should be among the more trivial for a new Erlang / CouchDB author to implement. I see no reason not to add this feature. If anyone wants to implement, and has questions or needs help getting started, the dev@ mailing list is the place. Cheers, Chris > regards, > Joscha > > -- > > > -- Chris Anderson http://jchrisa.net http://couch.io