0

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)

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84

1 Answers1

1

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

Roopa M
  • 2,171
  • 4
  • 12
  • Thanks for the answer, but as i said i don't need documents, but i need a way to list collections before and then i can loop through documents... Do you know if there is some way to get all the collections? not all the documents in a collection – Pietro Ciattaglia Dec 02 '22 at 14:42
  • @PietroCiattaglia Can you have a look at this [Example](https://stackoverflow.com/a/62466799/18265570) which works with `node.js`? – Roopa M Dec 06 '22 at 08:58