I have 2 collections :
$collection1 = [
{ name : "aaa" , score : 10 },
{ name : "bbb" , score : 20 }
];
$collection2 = [
{ name : "aaa" , score : 30 },
{ name : "bbb" , score : 10 }
];
and I want to join them to get the following result :
$collection3 = [
{ name : "aaa" , score : 40 },
{ name : "bbb" , score : 30 }
]
merge() and union() didn't do the job for me .