Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 81513 invoked from network); 3 Apr 2009 20:14:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 20:14:09 -0000 Received: (qmail 16249 invoked by uid 500); 3 Apr 2009 20:14:08 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 16160 invoked by uid 500); 3 Apr 2009 20:14:08 -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 16150 invoked by uid 99); 3 Apr 2009 20:14:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 20:14:08 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.132.242 as permitted sender) Received: from [209.85.132.242] (HELO an-out-0708.google.com) (209.85.132.242) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 20:14:01 +0000 Received: by an-out-0708.google.com with SMTP id b2so750156ana.5 for ; Fri, 03 Apr 2009 13:13:40 -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:message-id:subject:from:to:content-type :content-transfer-encoding; bh=e544/NqPiBfdiCh+V25Mt2rVaNlE5lFQUM8KLzs8FJY=; b=qDjn4ZG4v1eHroqQk5EwdFc6PNr3+N9dmMia0iUX6k89+NP5N08KUrKiX2U0u4Grb+ IUYvsYCP7+qVJbr8NbKbEt3oR5tsAb+ryQoXU+EvpulXfwhYaa1OWEFiZit2gU23sWrv EQWTjKJLXpUXX5Qweg/Vrik/yfjw/8T1mnPzw= 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=CQmsX7KIIP8kthToV23/K4bh5CqoPCE2td8q7Bs0JGI88dxZ/dSlYypsEOUjLZjixA RNvHFQBYM3xuIpryugx0f31zNVWUFnrArzAYaMBMrBqMnlkts16te3k3QPUKnAc2yL4U UVz5VEzVfo+zusZpdWaFTx+ypT+YkKyou5U10= MIME-Version: 1.0 Received: by 10.231.10.68 with SMTP id o4mr405050ibo.33.1238789620409; Fri, 03 Apr 2009 13:13:40 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Apr 2009 16:13:40 -0400 Message-ID: Subject: Re: rev of aggregate results From: Paul Davis To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Apr 3, 2009 at 4:04 PM, Adam Wolff wrote: > Oh, I'm not concerned that I'm not seeing the most recent info -- just > wondering what's the fastest way to find out if the application has > the most recent data. > > Tell me more about "view tags." That may be exactly what I'm looking > for. Is that an ETAG for the view results? > Exactly. I should've been more specific. Also, it looks like etags are already in. > A > > On Fri, Apr 3, 2009 at 11:59 AM, Paul Davis = wrote: >> Maybe I'm missing something, but assuming you're not using the >> stale=3Dok flag you should be guaranteed that the view you're seeing is >> the most recently completed update after your request was received. >> Ie, it'll wait if the view is being updated. >> >> If view tags are in trunk that'd capture the information on the state >> of the btree. I'm not sure if that patch has made it in yet though. >> >> Or I could be way off base with what you're asking. >> >> HTH, >> Paul Davis >> >> On Fri, Apr 3, 2009 at 2:32 PM, Adam Wolff wrote: >>> Hi, >>> I've noticed a pattern that appears in a couple of places in our app. >>> We have views which return multiple documents for a given key. What's >>> the fastest way that we can determine if we have the current rev of >>> the view, if we define a view's rev as the id and revs of all the >>> documents in the view? >>> >>> The solution I've thought of so far is to write the view's map >>> function like this: >>> >>> map : function(doc){ >>> =A0 var key =3D computeKey(doc); >>> =A0 emit([key, doc.id, doc.rev], null); >>> } >>> >>> We query the view with startkey=3D[key, null, null]&endkey=3D[key, {}, = {}] >>> and the rev for that key is just the text of the response. We haven't >>> gotten all the way through this, but it sees like it should work. My >>> concern is that this string will get unwieldy when there are a lot of >>> docs in the result set. >>> >>> Is there a recipe for determining the rev of a document collection? >>> Something in the semantics of id or rev that I've missed? >>> >>> Thanks in advance, >>> Adam >>> >> >