I have collection of documents. Document have a field which value is an array of maps (for example: map with one field name
). Structure is like that:
{
arrayfield: [
{
name: "value1",
},
{
name: "value2",
}
]
}
I want to fetch documents whose arrayfieds
all maps contain values from specified array. Documentation says that I can use containsall
operator. I use it in this way:
select from SomeCollection where arrayfiled containsall (name in ['value1','value2'])
But this construction always returns empty result. Where I do mistake? Thanks.
PS: If my question not understandable, I can post more detailed example of the collection and and a result which I want to receive.
Found a solution to solve my issue without containsAll:
select from SomeCollection where not (arrayfield contains (fname not in ["value1", "value2"]))