The documents in my collection("users") look like this:
{
_id: ObjectID(...),
verifiedFields:
{
email: ["[email protected]", "[email protected]"],
phone: [...]
},
profiles:
[
{
_id: ObjectID(...),
fields:
{
email: { value: "[email protected]" }
}
}
]
}
I would like to now select all users who's profiles.field.email.value is contained within their verifiedFields.email. I would like to avoid having to store a boolean verified as the user should be allowed to have multiple profiles with the same fields and this would cause complications later on.
Thanks in advance!