On Mar 23, 2016, at 3:57 PM, Brendan Duddridge 
<[email protected]<mailto:[email protected]>> wrote:

For example, I want to display a list of movie genres that's derived from a 
list of movies. Many movies have the same genre. But I wanted a view that 
contained the keys that were the unique Genre names of all the movies in the 
database.

That’s what the grouping feature of queries does. Set query.groupLevel=1 and 
the result will contain one row for every unique key. (See the docs.)

The solution you posted isn’t going to work because the map block uses mutable 
external state, which isn’t allowed. In this case it looks like there’d be 
trouble if you deleted all the docs with a specific genre, then added another 
one with that genre; it wouldn’t emit anything.

—Jens

-- 
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/2F8C1428-08A0-4CCD-A22D-36E50FB50CE3%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to