Or maybe you can modify your original data set so it doesn’t have those 
duplicates?  Not sure that’s possible.  

-- chad


On Tuesday, December 31, 2013 at 1:11 PM, Gerald Sangudi wrote:

> Thomas,
>  
> It seems that you have two choices:
>  
> - N1QL
>  
> - write the first map-reduce view, query it and store the results in 
> documents, then write a second map-reduce view
>  
>  
> On Tue, Dec 31, 2013 at 4:02 AM, Thomas <[email protected] 
> (mailto:[email protected])> wrote:
> > Hi and sorry for the spam, I have also found this post which says that it 
> > is not possible to do a second map/reduce on the results on a first 
> > map/reduce?
> >  
> > http://www.couchbase.com/communities/q-and-a/mapreduce-chain-couchbase
> >  
> > Any ideas of how to implement this  
> >  
> > Thanks
> >  
> >  
> > On Friday, 27 December 2013 18:05:48 UTC+2, Thomas wrote:
> > > Hi,
> > >  
> > > I was googling around for a solution of a map/reduce where I will be able 
> > > to perform a distinct/unique count of user ids, but I wasn't able to find 
> > > a concrete solution/answer to this topic. My case is to count the unique 
> > > users per day for example as well as other criteria.  
> > >  
> > > I have for example the following JSON documents of events:
> > >  
> > >  
> > > {"user":"user1", "color":"blue"}
> > > {"user":"user1", "color":"blue"}
> > > {"user":"user1", "color":"red"}
> > > {"user":"user2", "color":"blue"}
> > >  
> > >  
> > > And with my map/reduce view I want to do the following  
> > >  
> > > * number of distinct users per color
> > >  
> > > > { color: blue, count: 2}
> > > > { color: red, count: 1}
> > >  
> > >  
> > >  
> > > in SQL terms  
> > >  
> > > > select color, count(distinct user) as users from test group by color
> > >  
> > > Thanks
> > --  
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "Couchbase" group.
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/couchbase/ujEZzp1XXlk/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to 
> > [email protected] 
> > (mailto:couchbase%[email protected]).
> > For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "Couchbase" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> (mailto:[email protected]).
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to