Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
Calling multiple documents from nested collection firebase

I have a nested collection in firebase that goes like this:

await fire.firestore()
    .collection("groupsCategory")
    .doc(groupID)
    .collection('events')
    .doc(eventID)
    .collection("memberPicks")
    .onSnapshot((querySnapshot) => {
        if(isMounted){
            console.log("print indi event heree  " + querySnapshot.data().eventID)
       
            setEventName(querySnapshot.data().eventName)
            // setIndividualEventDetails(querySnapshot.data())
        }

when we get to memberPicks collection it looks like this:

What I'm trying to do is basically add all of the contents of this collection to a list so that I can count how many times each name is called.

But I am failing to combine all of the documents in this collection with the code I have above and I am not sure where I am going wrong

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Your querySnapshot is a QuerySnapshot object, which represents a list of documents. So it doesn't have any data() property itself, but instead exposes a list of documents in its docs property.

To show the event ID for each of the documents in your query snapshot, you could do:

.onSnapshot((querySnapshot) => {
    if(isMounted){
        querySnapshot.docs.forEach((doc) => {
            console.log(doc.data().eventID)
   
            setEventName(doc.data().eventName)
        });
    }
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!