Skip to content Skip to sidebar Skip to footer

How Do I Get Data From Two Collections In Firestore?

I have the following problem. I try to manage a n to m structure with firebase. Therefore i made three collections. collections |-----cards |----name |----text |--

Solution 1:

According to the comments:

Q: So you want to get all the cards which are in this list in a single go?

A: Yes thats the plan.

You need to know that Firestore does not have any API to get documents from multiple collections in a single step. You will have to use two (or more) separate calls. In your particular case, you should create one to get the documents under cards collection, and another one to get the documents in the cardlist collection based on the relationship between them.

For more information, please also take a look at:

Post a Comment for "How Do I Get Data From Two Collections In Firestore?"