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

154
Views
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
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!