Here's the sample document I'm trying to query
{
"_id":"asdf0-002f-42d6-b111-ade91df09249",
"user":[
{
"_id":"14bfgdsfg0-3708-46ee-8164-7ee1d029a507",
"n":"aaa"
},
{
"_id":"aasdfa89-5cfe-4861-8a9a-f77428158ca9",
"n":"bbb"
}
]
}
The document has 2 user references and contains the user _id and other misc information. I have the 2 user ids and am trying to get this document via only the user ids. I also don't know the order of the 2 ids. Is this a possible query?
col.findOne({
user:{
$all:[
{
_id:"14bfgdsfg0-3708-46ee-8164-7ee1d029a507"
},
{
_id:"aasdfa89-5cfe-4861-8a9a-f77428158ca9"
}
]
}
})
^^ Something that I've tried that doesn't work.