I faced many limitations with Firestore:
- cannot use multiple
not-in
- You can't combine
not-in
within
,array-contains-any
, oror
in the same query - every array filter can only check up to 10 values.
So I basically thought about changing data structure and use maps since they can be queried via field.key
.
the key field
of every document is not dynamic but each key
of the map is.
this is an example of my structure:
// the collection
animals
// the document (random id)
dog
// the field (a map value)
food: {
1: true
2: true
3: true
}
The question the query should answer is: "Give me every record where a specific value does not exist AND (other constraints)"
I am considering changing stack for this project because of this. Any good advice is also welcome.