Last year Firestore introduced support for IN
queries: here's the announcement, and here is their documentation.
At the same time as in
queries Google also introduced array-contains-any
. Our company has had a need for in
queries in Retool, not yet for array-contains-any
, but I could definitely imagine we will in the future.
The use-case in which we'd like to use in
queries: we'd like to list all documents in a Reports
collection where the document's state
field is set to READY FOR PROCESSING
or to READY FOR REVIEW
(= needs our attention). The Firestore query in JavaScript would be .where("state", "in", ["READY FOR PROCESSING", "READY FOR REVIEW"])
.
If the list of states is static (hard-coded) a workaround in Retool is to have separate queries and combine them in tables with query1.data.concat(query2.data)
. That's unpleasant because we need to maintain N
practically-identical queries for N
states to follow. In addition, I'm not aware of any available workaround for when the list of states is dynamically generated.
We'd appreciate support for Firestore's in
queries in Retool!