incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <>
Subject Re: Doubt on map/reduce and "joins" by id
Date Mon, 15 Oct 2012 16:06:01 GMT
Hi Andrea,

> - Customer: {    customerID,     customerName,   address,   branch, branchID}
> - Product: {  productID,    productName,     category_1ID, category_1Name,    ...
>    category_xID,    category_xName,    priceStandard}
> - Orders: {    orderID,    orderRowNumber,    customerID, productID,    price,    quantity,
> (...) so i should do a "Join" based on productID from Order and Product.

Please be aware that using Map/Reduce will force you to reduce drastically the number of "joins"
you'll make.
To do that, you'll:
- define one single object (aka document) for several relational rows, 
- or, as a last resort, do some joins outside of CouchDB (on client side or on a proxy service).

> I must get the category count for each productID and return with the other results of
the view

Could you be more explicit about the final result you would want to get?
Is it the count of products sold by category to a given user?


View raw message