const bookHistory = await BookHistory.aggregate([ { $match : { readerId : "5ec3f547209caf11b9c24f7b" } }, { $lookup: { from: 'books', localField: 'bookId', foreignField: '_id', as: 'bookName2' }, }, {$unwind:'$bookName2'}, { $project:{ bookName:'$bookName2.name', returnDate: 1, act: 1, actDate: 1, readerId: 1 } } ])
Обсуждают сегодня