I am not sure how to pass in an array of IDs into Product.find(). This is basically what I have done in the NodeJS. I am able to get the data from the console log(category) and returned the _id and title. But when I tried console.log(category._id), it returned undefined. What I want to achieve is to pass the _id into the product.find with an $in operator: Product.find({catid:{$in:category.id}}) but is not working, and I am not sure how to? Greatly appreciate for any helps and many thanks in advance. Thanks again
let category = []
const category = users.category
console.log(category) // [{"_id":"5feb2122a8632e0550deb43b","title":"A"},{"_id":"5fedef35259fd41fec38bc70","title":"B"},{"_id":"5ff14b9ba012a42238acdcd3","title":"C"}]
console.log(category._id) //undefined
Product.find({catid:{$in:category.id}})