Search code examples
pythonfirebasegoogle-cloud-firestorefirebase-admin

How do I do a join of two tables in firebase_admin for Python?


I am unable to find a way to join two firestore tables in python. Does anyone have any information on this?


Solution

  • Firestore doesn't have the concept of server-side joins, no matter what SDK you use.

    If you want information from multiple collections, your options are:

    • To perform a separate read for each collection (and possibly for each document) in your application code, essentially performing the join operation client-side.
    • To duplicate the information into the the documents from one collection, so that you only have to read from that collection.

    Neither of these is pertinently better than the other, but you're roughly trading having data duplication against performing more operations from your app.