Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

332
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda