Pietro Ciattaglia
Pietro Ciattaglia

Reputation: 45

How to Get all Firestore Collections and Documents? | React JS

I'm doing a fundraiser from different communities with different landing pages (adding a new one each day), each landing page instantiates a new collection on my database and records the data of the user who donated.

Now I should find a way to show the user on the front end, all the donations he has made. Being that the front end site from which the user can see the transactions is the same for everyone, how can I do it?

**WHAT I FOUND: **

listCollections() - but there's no function with this name in firebase/firestore

Make a collection containing all the other (but if so i i'll need to manually fetch each one and the communities are increasing day by day so i don't want to manually update the code every new community)

Upvotes: 0

Views: 480

Answers (1)

Roopa M
Roopa M

Reputation: 3029

The listCollections() is available in server-side sdk. It is not available in client-side sdk like web/mobile libraries.

You can use onSnapshot to listen to real time updates in documents as mentioned in this similar thread1 & thread2

To retrieve documents from group of collection use collection group query

Upvotes: 1

Related Questions