View collation are incomplete joins in 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;
}