I want to find all documents containing the word "school" in ANY of their subdocuments fields, for example, if we have two documents:
{
name: "aa",
schools: [
{
name: "high school",
description: "aaaa"
},
{
name: "a1",
description: "blabla bla school"
},
...
],
},
{
name: "bb",
schools: [
{
name: "bbb",
description: "First school of ..."
},
{
name: "b school",
description: "bbb bb b",
...
}
],
},
These documents should match with the name or/and description of the first or/and second school.
I tried this query without success:
{
schools: /.*school.*/
}
And this too, by listing fields:
{
school: [
{ name: /.*school.*/ },
{ description: /.*school.*/ },
...
]
}
Is their a way to perform this?