I have the next data structure in firestore:
{
"votes_yes":[
"id1",
"id2",
"id3",
...
],
"votes_no":[
"id4",
"id5",
"id6",
...
],
}
I want to build a query, which will return me a list of documents where the user has voted.
To do that I need to check if his id
exists in one of those arrays.
I can easily do it for one array with help of array-contains
:
ref.where('votes_yes', 'array-contains', `userId`).get()
But is it possible to do logical OR
for array-contains
?
I didn't find anything useful in the doc... :(