Database

db={colA:[{_id:"8af051fd-feaa-4a81-b34f-327513210eab",docId:"12345689",name:"Office 1",country:"Spain"},{_id:"87c36ae2-5e9f-4cda-9bf5-087e96fb71b9",docId:"12345680",name:"Office 2",country:"San Tomé e Príncipe"},{_id:"7ec73cb0-657a-4a91-861c-fccf04c8c2a7",docId:"12345688",name:"Office 3",country:"Canada"}],colB:[{id:1,docId:"12345689",name:"Office 1",smtp:null},{id:2,docId:"12345680",name:"Office 2",smtp:"smtp.gmail.com"},{id:3,docId:"12345688",name:"Office 3",smtp:"smtp.office365"},{id:4,docId:"12345638",name:"Office 4",smtp:"smtp.host.com"},{id:5,docId:"12345699",name:"Office 5",smtp:"123.321.456"},]}

Query

db.colA.aggregate([{"$lookup":{"from":"colB","localField":"docId","foreignField":"docId","as":"bList"}},{$match:{bList:{$ne:[]}}},{$set:{smtp:{$first:"$bList.smtp"}}},{$unset:"bList"}])

Result