Database

db={"books":[{"_id":ObjectId("63208c9f0d97eff0cfbefde6"),"title":"There and back again","author":"Bilbo Baggins","publisher":"Middle Earth Books"},{"_id":ObjectId("63208cd10d97eff0cfbeff02"),"title":"Two Towers","author":"JRR Tolkin","publisher":"Dude Books"},{"_id":ObjectId("63208cf10d97eff0cfbeffa3"),"title":"Dune","author":"Frank Herbert","publisher":"Classic Books"},{"_id":ObjectId("63208d1d0d97eff0cfbf0087"),"title":"Old Man's War","author":"John Scalzi","publisher":"Old Man Books"}],"subscribers":[{"_id":ObjectId("63208c2e0d97eff0cfbefb46"),"name":"Tom","checkouts":[{"bookId":ObjectId("63208cd10d97eff0cfbeff02"),"checkoutDate":ISODate("2022-01-01T21:21:20.202Z")},{"bookId":ObjectId("63208d1d0d97eff0cfbf0087"),"checkoutDate":ISODate("2022-01-02T21:22:20.202Z")}],"address":"123 Somewhere"},{"_id":ObjectId("63208c4e0d97eff0cfbefc1f"),"name":"Bob","checkouts":[],"address":"123 Somewhere"},{"_id":ObjectId("63208c640d97eff0cfbefc9a"),"name":"Mary","checkouts":[],"address":"123 Somewhere Else"}]}

Query

db.subscribers.aggregate([{$match:{_id:ObjectId("63208c2e0d97eff0cfbefb46")}},{"$unwind":"$checkouts"},{$lookup:{from:"books",localField:"checkouts.bookId",foreignField:"_id",as:"book_tmp_field"}},{$addFields:{"checkouts.title":"$book_tmp_field.title"}},{$project:{book_tmp_field:0}},{"$group":{"_id":{_id:"$_id",address:"$address",name:"$name"},"checkouts":{"$push":"$checkouts"}}},{"$replaceRoot":{"newRoot":{"$mergeObjects":["$_id",{checkouts:"$checkouts"}]}}}])

Result