{
foo: "bar",
users: [
{ "name": "john", "age": 25, "level": 3 },
{ "name": "bob", "age": 28, "level": 2 },
{ "name": "jane", "age": 32, "level": 1 },
{ "name": "mary", "age": 18, "level": 4 }
]
}
Given a document structure such as the above, is possible to structure a
query such that the parent document is only returned if it contains a child
document matching a set of boolean criteria?
For example, I would want to run a query saying "search for documents
containing a user who has age>=25 and level>=3".