Database

db={employees:[{"_id":"621eedae92979fd8f0e9451d","name":"Pallab Koley","shifts":{"_id":"62636b9fcbda6d2b17f5cae0","month":"2022-05","shift":[{"date":"2022-05-01","shiftId":"622bb0f4b88dc92e3c2cac56"},{"date":"2022-05-02","shiftId":"622b55f8f59dcdd1ab9b36b1"},]}},{"_id":"62626a7446ba9a911a623b37","name":"Pinki Das","shifts":{"_id":"62636ba4cbda6d2b17f5cae1","month":"2022-05","shift":[{"date":"2022-05-01","shiftId":"622bb0f4b88dc92e3c2cac56"}]}}],shifts:[{_id:"622bb0f4b88dc92e3c2cac56",name:"Day"},{_id:"622b55f8f59dcdd1ab9b36b1",name:"Morning"}]}

Query

db.employees.aggregate([{"$unwind":"$shifts.shift"},{"$lookup":{"from":"shifts","let":{shiftDate:"$shifts.shift.date",sid:"$shifts.shift.shiftId"},"pipeline":[{"$match":{$expr:{"$eq":["$_id","$$sid"]}}},{"$addFields":{"date":"$$shiftDate"}}],"as":"shifts.shift.shiftId"}}])

Result