I have a MongoDB object with an array of objects inside it, structured as
{
otherInfo: String,
invited: [{
code: String,
email: String
}],
moreInfo: String
}
I'm trying to find a specific object in that array with a specific code, and then get the email associated with that code.
I have tried .find({ invited: { $all: [{ code: 1234567890 }]}}) but it didn't return anything. I have tried other variations on it none none of them seem to have worked