Database
db={employees:[{"_id":ObjectId("5e41877df4cebbeaebec5146"),isActive:true},{"_id":ObjectId("5e4187d7f4cebbeaebec5147"),isActive:true}],careers:[{employeeId:ObjectId("5e41877df4cebbeaebec5146"),isCurrentlyWorking:true,position:"a"}]}
Query
db.employees.aggregate([{$match:{isActive:true}},{$lookup:{from:"careers",localField:"_id",foreignField:"employeeId",as:"career",pipeline:[{$match:{isCurrentlyWorking:true}},{$project:{position:1}}]}},{$unwind:{path:"$career",preserveNullAndEmptyArrays:true}},{$set:{career:{$ifNull:["$career",null]}}}])