I'm trying to filter a firestore collection based on an object in an array. I have an array of categories and I want to filter by a specific category. I read in this answer that you have to use the full object as the query value.
In this example, the object is {'level': 1, 'name': "Furniture"}
If I use this value through the API using node it returns relevant documents.
However when I'm running the query in firestore's web interface, it's not returning any matches. I'm guessing it's because it's wrapping the object in quotes because the data type is a string...
query from node:
.collection("products").where("categories", "array-contains", {'level': 1, 'name': 'Furniture'})
query preview when using firestore web interface:
.collection("products").where("categories", "array-contains", "{'level': 1, 'name': 'Furniture'}")
Is this a limitation of using the web interface or am I doing something wrong here? The only data types I can use in array-contains are string, number and boolean.