I am trying to search for the current item:
I tried the following: {participants: {userEmail: 'test@gmail.com'}}
But it did not return anything.
Im mongoDB compass i get the following in my query history:
How would i write the query to find the highlighted email address? Or the document holding that email address.
Thanks.
Your query expects that participants is exactly an object like:
{userEmail: 'test@gmail.com'}
What you're trying to do can be achieved with dot notation:
{ 'participants.userEmail': 'test@gmail.com'}}