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

331
Views
how to fetch subcollection's data in firestore

I am trying to fetch a collection' data called highlights that has a doc and another collection , I want to retrieve only the data : enter image description here enter image description here enter image description here

  const fetchHighlight =async()=>{

    const HighlightDbId =  await db.collection('highlights').doc('2SCS2S0JnzngWEiYkHNk')
.collection('hBYWvZ3KN3NLLrucTpryeTQZnHz2').get()
    console.log(HighlightDbId)

    }
React.useEffect(()=>
    {
      fetchHighlight ()
     
    }, [])

How can I retrieve this collection's data (tag,teamColor, team ...) This is what I get when i console log : enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are good hands on examples for all the basic cases such as this one. In your code, you get the snapshot of the collection query right, but you need to iterate docs on in snapshot object.

Look for more in here: https://firebase.google.com/docs/firestore/query-data/get-data#get_multiple_documents_from_a_collection.

about 4 years ago · Juan Pablo Isaza 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!