couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <kocol...@apache.org>
Subject Re: Map/Reduce Question
Date Thu, 02 Dec 2010 19:28:06 GMT
On Dec 2, 2010, at 10:19 AM, Matthew Woodward wrote:

> On Thu, Dec 2, 2010 at 3:46 AM, Robert Newson <robert.newson@gmail.com>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.

You need to perform the query with ?group=true.  Best,

Adam

Mime
View raw message