Database
[{firstArray:[{name:"First object",value:1},{name:"Second object",value:2},{name:"Third object",value:3},{name:"Fourth object",value:4}],secondArray:[{name:"First object",anotherValue:1},{name:"Second object",anotherValue:2},{name:"Third object",anotherValue:3},]}]
Query
db.collection.aggregate([{$project:{anotherValue:{$map:{input:"$firstArray",as:"one",in:{$mergeObjects:["$$one",{$arrayElemAt:[{$filter:{input:"$secondArray",as:"two",cond:{$eq:["$$two.name","$$one.name"]}}},0]}]}}}}}])