I have a document that looks like this:
{
"_id" : "AouRpb5g2WR9sZe5z",
"participants" : [
{
"user" : "CYvApwRFADveqBqEY",
"unread" : false
},
{
"user" : "sgoinZkaHbqth8nPr",
"unread" : false
}
],
"createdAt" : ISODate("2016-07-23T04:06:53.748Z")
}
I need to be able to find the document that has both users 'CYvApwRFADveqBqEY' and 'sgoinZkaHbqth8nPr'. I was able to find all documents with one of the users with elemMatch, but couldn't figure it out for both, or if that's even the correct way.