I need to present a list of Orders and a count of the OrderLines for each 
order. I currently use view collation 
(http://docs.couchdb.org/en/latest/couchapp/views/collation.html) and 
create a view that returns orders and orderlines and 'manually' count the 
orderlines, using a mapblock like this:

if ([doc[@"doctype"] @"orderline]) {
    emit(@[@(orderid)], nil);
}
if ([doc[@"doctype"] @"order"]) {
    emit(@[@(id), @"name"], nil);
}

Is there a better way to do this ? 

-- 
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/ad3a8a91-a079-4d7a-a026-7409cea2f3ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to