Hey guys, so in my schema i have an array of objects, it looks like this:
entries: [
{
name: 'frank',
age: 15,
email: 'frank@email.com'
},
{
name: 'daniel',
age: 18,
email: 'daniel@email.com'
}
]
So, what I need is: I want to query through this array of objects and check if it will match any of the values I provided. For example, lets suppose I have a name and a email - I need to build a query providing the name and the email and check if, in this array, the name or the email already exists.
But, I don’t want to query for exact match, i mean, i want to check if the email or the name already exists there, but both could be in separated objects.
On the example I provided, lets suppose I have the name frank and the email daniel@email.com and I make a query with both - both already exists so i do something with that…
The purpose is to avoid duplicated entries for example.