Multi-level Query?

Hello world. I’m working on an app for a friend for fencing coaches. Coaches belong to Clubs, and our data structure includes these levels:

  • Clubs (Collection)
    • Coaches (Collection)
      • Individual Coach Entries (Documents), including email address
        We’re trying to use a query so that, on log-in, the user only sees the Clubs to which they belong. The sixth video from the chat app demo gave us this sample query for filtering messages:

where(“userId”, “==”, “$slot(‘ds_SlotUserId’)”).orderBy(“timestamp”,“desc”)

However, how would we set up the query to look down a layer to see which Collections have a document the data values specified? Is there a resource somewhere that goes into the syntax of these queries? Thanks.

I dont think this is possible in Firebase. It’s a noSQL database so you would need to have own collection for each coach which contains the clubs the coach belongs.

If you’d use e.g. Xano’s backend for this then this would be a trivial task to do. It would be a custom API endpoint which returns whatever SQL queries you might want to have.

I don’t believe this is possible in Firebase. Because it’s a noSQL database, you’ll need a collection for each coach that contains the clubs to which the coach belongs.

Thanks for the reply. We were looking into this solution back in May. By now, we’re looking into cloud functions to solve this problem.