Wildcard in firestore query

Hello Retool Community!

Is there any way to pull all Subcollections from firestore without using parent collection parent IDs?

My Data
I have a collection of categories in our fitness app Firestore database (Balance, Beginner Yoga etc)

Each category has a subcollection with multiple documents. I am listing the documents category by category like this:

/categories/{{listOfClasses.selectedRow.data.CategoryID}}/subcategories

What I'm trying to do
I want to list all documents in each category in one list. Can you guys suggest me a way to do this?

All I have been able to do is list categories one-by-on by manually selecting the next category. Any ideas are welcome! Attaching my firebase structure and my retool query to access the data.

Hey Sunny - right now we don’t support collectionGroup queries in Firebase. I can post on here and let you know when we do build this.

In the mean time, there are two hacks that come to mind:

  1. using a js query in Retool to loop through all the collections and make a request for each one (this might be acceptable in the short-term if there is a small number of collections), or
  2. writing a Firebase function which performs a collectionGroup query and then hitting it with a REST query from Retool.
1 Like