I have a list of units in MongoDB with following schema:
[
{
code: Number,
institutes: [
name: String,
code : Number
]
}
]
I want to search through the database and return array of all objects whose either institute's name includes req.body.searchValue or whose institute's code includes req.body.searchedValue
What mongodb query can I use for above?