Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 93246 invoked from network); 11 Nov 2010 23:29:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Nov 2010 23:29:25 -0000 Received: (qmail 3752 invoked by uid 500); 11 Nov 2010 23:29:55 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3680 invoked by uid 500); 11 Nov 2010 23:29:55 -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 3672 invoked by uid 99); 11 Nov 2010 23:29:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 23:29:55 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mikebannister@gmail.com designates 209.85.216.52 as permitted sender) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 23:29:50 +0000 Received: by qwa26 with SMTP id 26so2441462qwa.11 for ; Thu, 11 Nov 2010 15:29:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=QMGf7ERbaEMG5THLik9yWhkFMAfFupeDQgb4l4anDSc=; b=F05I951hUe+5lxWqedIGqgHEHLJ4p6bbKgSWkGeSPw8VTd1rK0qextUOCaeEjnKONJ 76/khYf+hOUvGex6XVDjNyKGL1DyOwcREsKIlI7FpxDPoB54RUdet7M3qVTw6JDjjfjE OKLYCWHDFnw4nM2DbDU7CQpwrM+opml8y1zOY= 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; b=jKExKvJ5QtWX5tXA58fcWmjRK2IKwMZj/NvotsuyvLRnuh3hWcaatkwHKDj2uhlH2c DzoEdwtCndZTlvSRo4zcIXXiTtenAdWXSL4IQNtQZgVZh7CA58XJa1hcyCQbI4tsueu6 8Xt5jYmLN6oIIzfvIkOrY4WTJEpY53it/F8Eg= MIME-Version: 1.0 Received: by 10.229.241.69 with SMTP id ld5mr1229728qcb.229.1289518169270; Thu, 11 Nov 2010 15:29:29 -0800 (PST) Received: by 10.229.85.4 with HTTP; Thu, 11 Nov 2010 15:29:29 -0800 (PST) In-Reply-To: References: Date: Thu, 11 Nov 2010 18:29:29 -0500 Message-ID: Subject: Re: First doc in a group? From: Mike Bannister To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00163630e871692ad30494cf5874 --00163630e871692ad30494cf5874 Content-Type: text/plain; charset=ISO-8859-1 Cool, I understand now reduce isn't right, initially posted to the list because I couldn't decide that on my own. So what's the most efficient way to get the latest document for each user? Seems like I shouldn't have to do one query per user but I'm open minded (: -Mike On Thu, Nov 11, 2010 at 5:52 PM, Chad George wrote: > Selecting one row in a view out of many possible isn't what reduce is for. > > I try not to think of it as reducing a set of view results to a smaller set > but rather reducing each and every entry in the view to something smaller. > > The fact that reduce gets multiple view rows to work on at once is just an > optimization. I think its better to think of reduce as working on exactly > one view row at a time then rereduce the result to get final answer. > On Nov 11, 2010 5:22 PM, "Mike Bannister" wrote: > > Cory, cool thanks. Wasn't able to decide on my own if reducing was OK for > > this kind of thing. > > > > Robert, but I need one document for each user, wouldn't that be a summary > of > > sorts? > > > > -Mike > > > > > > On Nov 11, 2010 4:46 PM, "Cory Zue" wrote: > > > > You could emit the users as keys, and in your reduce function just > > return the latest by date. > > > > > > On Thu, Nov 11, 2010 at 4:35 PM, Mike Bannister > > > wrote: > >> Yeah, I'm trying... > --00163630e871692ad30494cf5874--