0

I'm trying to display total number of users registered in my Firebase realtime database and I want to display them. I tried using the one in the firebase docs but it doesn't work on me. I saw some tutorials but they are the previous SDK version.

Taneda
  • 3
  • 3
  • "I tried using the one in the firebase docs but it doesn't work on me." Please edit your question to show what you tried. Without seeing that, it is unlikely we can explain it better than the documentation already does. – Frank van Puffelen Dec 05 '22 at 15:59
  • I tried this one but I found out that its for firestone. const coll = collection(db, "cities"); const snapshot = await getCountFromServer(coll); console.log('count: ', snapshot.data() – Taneda Dec 05 '22 at 17:19
  • Check the links in the comments here: https://stackoverflow.com/questions/27750594/firebase-counting-the-number-of-records-in-real-time#comment43913495_27750594 and my answer here: https://stackoverflow.com/a/69076119/209103, https://stackoverflow.com/questions/15148803/in-firebase-is-there-a-way-to-get-the-number-of-children-of-a-node-without-load – Frank van Puffelen Dec 05 '22 at 17:21
  • Or you can use [Firestore](https://firebase.google.com/docs/firestore), and read this [resource](https://medium.com/firebase-tips-tricks/how-to-count-the-number-of-documents-in-a-firestore-collection-3bd0c719978f). – Alex Mamo Dec 06 '22 at 07:57

0 Answers0