Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26484 invoked from network); 2 Dec 2010 15:19:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Dec 2010 15:19:51 -0000 Received: (qmail 32910 invoked by uid 500); 2 Dec 2010 15:19:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 32787 invoked by uid 500); 2 Dec 2010 15:19:50 -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 32774 invoked by uid 99); 2 Dec 2010 15:19:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 15:19:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 15:19:44 +0000 Received: by wwb31 with SMTP id 31so6897180wwb.23 for ; Thu, 02 Dec 2010 07:19:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.157.11 with SMTP id z11mr325707wbw.122.1291303161856; Thu, 02 Dec 2010 07:19:21 -0800 (PST) Received: by 10.227.28.69 with HTTP; Thu, 2 Dec 2010 07:19:21 -0800 (PST) X-Originating-IP: [156.33.195.149] In-Reply-To: References: Date: Thu, 2 Dec 2010 07:19:21 -0800 Message-ID: Subject: Re: Map/Reduce Question From: Matthew Woodward To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001636832e2e42845304966ef27d --001636832e2e42845304966ef27d Content-Type: text/plain; charset=ISO-8859-1 On Thu, Dec 2, 2010 at 3:46 AM, Robert Newson wrote: > The simplest means to dedupe this is; > > function(keys, values, rereduce) { > return values[0]; > } > > Thanks! I'm sure I'm missing something, but I stuck this in as my reduce function and I'm only getting one result back total. Do I do some sort of for/each loop in there to get unique values for each key? Also this doesn't include the key in what's returned (key comes back null) and I'd like to have that in there. I haven't messed with that piece of things at all so I'll see if I can get that sorted out. Really appreciate the input. -- Matthew Woodward matt@mattwoodward.com http://blog.mattwoodward.com identi.ca / Twitter: @mpwoodward Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments. http://www.gnu.org/philosophy/no-word-attachments.html --001636832e2e42845304966ef27d--