I have a collection, the document in it looks like this:
{
"person-name" : "Hughart, Ron",
"info" : {
"birthnotes" : [ "Los Angeles, California, USA" ],
"birthdate" : [ "18 June 1961" ],
"birthname" : [ "Hughart, Ronald P" ]
}
}
I want to find the people who were born in Lisbon. The question is how do I know if a record's field "info.birthnotes"
contains "Lisbon"
?
I tried this command:
db.collection.find({"info.birthnotes": {"$in": ["Lisbon"]}})
but it returns nothing.
See Question&Answers more detail:os