On Apr 17, 2014, at 4:31 PM, J. Chris Anderson <[email protected]> wrote:

> say I got 3 records (color, type) and 2 of them have the exact same key and 
> the 3rd is totally different. My assumption is when groupLevel is 1, couch 
> separates them into two groups and call the reduce function twice. But the 
> logger says reduce is called 3 times although the final result is correct.

Can you post an example?

If you set the groupLevel to 1, all the rows with the same color (first item of 
key) will be grouped together, and the reduce function will be called on them 
to generate a single value. The resulting row in the output will have key equal 
to [color] and value being the reduce output.
If you set the groupLevel to 2, the rows with the same first two items in the 
key are grouped together.

In Couchbase Lite, the number of calls to the reduce function will be the same 
as the number of groups in the result. But you shouldn't count on this. CouchDB 
would call it more often on smaller numbers of rows, and Couchbase Lite may do 
that in the future as a memory optimization.

--Jens

(By the way, which platform are we talking about here, iOS or Android?)

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/932B213A-3C16-4FCE-B00E-7FAF7F38178D%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to