I have JSON like this:
{
"array": [
{
"object1": {
"key1":"value1",
"key2":"value2",
"key3":"value3"
}
},
{
"object2": {
"key1":"value1",
"key2":"value2",
"key3":"value3"
}
}
]
}
I want to get to the key inside object in MongoDB by db.collection.find(), but I can't figure out what to type inside parentheses. I tried: db.collection.find({"array":{"object1.key1":"value1"}});
but it doesn't work.