If I have a collection like this:
Logos:
Logo1:
colors: ["red","black"]
shapes: ["square","circle"]
Logo2:
colors: ["red","yellow"]
shapes: ["square"]
And if I want to search logos that are red or black, I would do the following:
db.collection("Logos").where("colors", "array-contains-any", ["red", "black"]).get().then((querySnapshot) => {
//do stuff
})
And that would get me all the Logos in my collection that contain the color red or black. However, how would I be able to do a search for logos that are (red OR black) AND (circle OR square) but I cannot combine multiple array-contains-any operators.
Is this even possible in Cloud Firestore? If not is there any alternative way to do this?