My documents are structured similarly to this:
{
primaryToken: 123,
settings: {
tokenList: [
{
number: 987,
status: ACTIVE
},
{
number: 123,
status: INACTIVE
}
]
}
}
How can I query for documents who have a token in the tokenList that matches the primaryToken and has in a status of ‘INACTIVE’.
I have tried the following, but it does not work:
{
settings.tokenList : {
$elemMatch : {
number : $primaryToken,
status : INACTIVE"
}
}
}