You want groupLevel=1 because you want to aggregate rows based on the first 
element of the key (the order ID.)

In the first emit() call, just emit the orderID as the key and no value:
                emit(@(orderId), nil);

In the second emit() call in your map function, make the key just the orderID 
and put the rest of the info in the value, i.e.
            emit(@(orderId), @[firstName, lastName, email, phone, vip, 
avatarUrl]);

Now your reduce function will be called with an array of values, the last of 
which will contain the order info, the rest empty. It then returns the order 
info, appending the count of values minus 1.

—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/D2AF3A1F-165A-479D-AD63-F597EDDE14F7%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to