MongoDB select by nested data
I am trying to query embedded data in MongoDB.
Ideally I would like to run a query similar to:
SELECT FROM attributes.type1 WHERE value = true
I understand that I can use dot notation to query on .type1 attributes, but can I query deeper than that?
Thank!
My dataset:
{
"attributes": {
"type1": [
{
"year": "2012",
"value": "true"
},
{
"year": "1998",
"value": "false"
}
],
}
}
+3
source to share