Database

[{"_id":ObjectId("5f0d6e394556410d486f6828"),"branchId":"exampleId","info":[{"date":"12-10-09","programs":[{"programId":"ObjectId1"},{"programId":"ObjectId2"},{"programId":"ObjectId3"}]}]}]

Query

db.collection.aggregate([{$match:{_id:ObjectId("5f0d6e394556410d486f6828")}},{$unwind:{path:"$info",preserveNullAndEmptyArrays:false}},{$project:{branchId:1,"info.date":1,"info.programs":{$filter:{input:"$info.programs",as:"p",cond:{$in:["$$p.programId",["ObjectId1","ObjectId2"]]},},}}},{$group:{_id:"$_id",branchId:{$first:"$branchId"},info:{$addToSet:"$info"}}}])

Result