I have the following type of documents in my MongoDB database:
[
{
"_id": {
"$oid": "63267309592e38db589c576d"
},
"name": "ASOS DESIGN tapered smart shorts in white and navy stripe",
"color predictions": [
{
"Beige": {
"$numberInt": "1"
}
},
{
"Black": {
"$numberInt": "2"
}
},
{
"White": "1"
}
],
"color": "Black"
},
{
"_id": {
"$oid": "84253452492e38db589c576d"
},
"name": "ASOS DESIGN tapered smart shorts in white and navy stripe",
"color predictions": [
{
"Brown": {
"$numberInt": "3"
}
},
{
"Green": {
"$numberInt": "1"
}
},
{
"Navy Blue": "1"
}
],
"color": "Brown"
}
]
I would like to pull documents based on a list of colors by matching them to values found in the color predictions column:
for example I would like to query ['Brown', 'Navy Blue'] and get the second document and any other documents that have those colors in the color predictions column.
How can I craft a query to get those documents?
Thank you, any help would be great.