I want to find all documents that have, in an array of subdocuments, a value that matches anything within another array.
Documents
{
storeName: String,
location: String,
inventory: [{
itemName: String,
price: Number,
otherDetail: String,
}]
}
Example array
let itemNames = ["chair", "bed", "table"];
I am using aggregate. I need to find all stores (documents) that have in the inventory any of the itemNames in the array.