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

155
Vistas
How to read all nested collections of all users on firestore?

So I'm aware you can read through your own nested collections while having the following:

db.collection('usuarios').doc(user.uid).collection('pedidos').doc()

but that would only read all the "pedidos" of that current user

I'm making some kind of "admin" so I need to see ALL the "pedidos" of ALL users and if I remove the values of .doc(user.uid) it will not go through all users it will just not do anything

ej: db.collection("usuarios").doc().collection("estudiantes") <- This didn't work

So I'm looking for a way to read all users nested collection

I can read all users without issues is as simple as db.collection("usuarios") but I need to access their nested collection and I can't do something like db.collection("usuarios").collection("pedidos") that will give me an error. Any help is welcome

enter image description here

update based on suggestion

useEffect(() => { 
    const usuariosRef = db.collectionGroup('pedidos').get()
    usuariosRef.onSnapshot(snapshot => {
      const tempData = [];
      snapshot.forEach((doc) => {
        const data = doc.data();
        
        tempData.push(data);
      });
      setEstudiantes(tempData);
    })

}, [user]);

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