I have such structure in my Mongo db:
{'_id':'...',
'friends':
{'id1': {'name1':'value1', 'name2':'value2'},
'id2': {'name1':'', 'name2':''},
...}
}
How can I find element(friend) in this dictionary(friends) by name1(value1)?
db.myCollection.find({"friends.id1.name1":"Sam"})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With