I have a JSON format like this
{"id":123,"person":{"name":"test","age":123,"address":"test"}}
How to find the record use id and person name?
I tried the following:
db.test.find({"id":123,"person":{"name":"test"}})
It didn't work.
Join Stack Overflow to learn, share knowledge, and build your career.
I have a JSON format like this
{"id":123,"person":{"name":"test","age":123,"address":"test"}}
How to find the record use id and person name?
I tried the following:
db.test.find({"id":123,"person":{"name":"test"}})
It didn't work.
Here is the answer, notice the person.name
piece that is different than the question:
db.test.find({"id":123,"person.name":"test"})