bookHistory:(memberId)=>{
return new Promise(async(resolve,reject)=>{
const historyData=await db.get().collection('bookborrow').find({userId:(memberId)}).toArray()
const bookid= await historyData.map(element => {
return element.data.bookname
})
console.log(bookid)
const getBookName=await db.get().collection('bookdetails').find({_id:{$in:[objectid[bookid]]}}).toArray()
console.log(getBookName)
})
}
historyData is output is look like ['62e53c1ff5d4c45fb7853d9e','62ea6268fd2fe8616cd4c17b'] and i need to data get this _id data from another collection