Indeed, as you mentioned, it's not possible to use more than one array-contains-any
per query. As mentioned by one of Firebase developers in this Github issue, this is the reason why it's not implemented:
We don't support this currently because we're worried about the combinatorial explosion of index rows required to support this kind of query. We're not planning on adding support for this any time soon.
Considering that, as alternatives for your usage, I have found this post from the Community here, that indicates two possibilities to substitute the querying with multiple arrays.
I think the one that you could try - as described in this answer - and that would fits you better, would be to preset first the values as properties, so you can use them in your code directly. The example of code would be something like the below.
nAmenities = {
"wifi": true,
"pool": true,
...
}
nServices = {
"parking" = true,
"yoga" = true,
...
}
list.forEach( (val) => {
ref = ref.where(`nAmenities.${val}` , '==' , true);
ref2 = ref2.where(`nServices.${val}` , '==' , true);
//query of select using these above nAmenities and nServices variables
});
This code is not tested, but I believe it might help you as a starting point. Besides that, I really encourage you to take a look at the other Stackoverflow Question, to verify all their clarifications and explanations.
Let me know if the information helped you!