Filter on reference fields in the Firestore panel
There is currently no way to filter on reference fields in the Firestore panel of the Firebase console.
-
Abtin Gramian commented
The Firebase team also explains in a now 6 year old video (https://youtu.be/Elg2zDVIcLo?t=276) that the main value of reference types is in the Firebase console UI.
It is stated that if a field is set to a reference type, when editing the field you will get a rich editor allowing you to select another document instead of just typing an arbitrary string which would be prone to mistakes or referencing non-existent documents.
Unfortunately that feature still doesn't exist. And since the feature to filter documents based on a reference field is also missing from the Firebase console, reference fields seem to serve no purpose and provide no additional value compared to using a string id pointing to another document.
-
Falcon Chacon Falcon Chacon commented
This is very much needed.
-
Jimmie Tyrrell commented
It's very surprising that this feature is not available. I recently migrated some data from several subcollections over to a root-level collection, because it was impossible to do batch changes across multiple subcollections. Now, the data is not only much harder to search through in the Firestore web UI, it's impossible to find via its reference (which used to be its parent).
I have created tooling in Retool to help manage my data. But unfortunately Retool doesn't support this feature either :\ I will try making a custom REST call in Retool to execute a StructuredQuery.. -
Alejandro Barone commented
For the record: I created a StackOverflow question with this on April (https://stackoverflow.com/questions/76059452/how-to-query-by-reference-in-firestore-using-the-cloud-console), and filled a feature request on the same days, so It have a little bit more time acknowledged by the firebase team. Hope it get release soon 🙏
-
Gustavo Pacheco commented
Duplicate of https://firebase.uservoice.com/forums/948424-general/suggestions/47243750-filter-on-reference-fields-in-the-firestore-panel. Better delete this one to avoid vote fragmentation.
-
Tarounen commented
There is currently no way to filter on reference fields in the Firestore panel of the Firebase console.