View collation are incomplete joins in couchdb I was trying to create view collations following this tutorial: http://elegantcode.com/2012/02/14/view-collation-in-couchdb/ but I realize that the result was an array with 5 elements with 2 objects types instead of an array with 2 items and those items with another array. Am I supposed to organize this array when I receive the result? Or is there another way of doing relationships on couchdb?
Ok, I found the solution, I have to use the reduce function for that, like: 

function(keys, values, rereduce){
var result = null; 
var orders = []
for(var i =0; i&lt; values.length; i++){
if(values[i].type=='customer') result = values[i];
    else{
          orders.push(values[i])

    }
}
result.orders = orders;

return result;
}