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

365
Vistas
Getting the data of nested collections in angular 12

I am making my first angular/Firestore app and I am having some trouble understanding how to retrieve data in nested collections. My Firestore dB path I want to read from is here:

/Customer(CollectionName)/cl0Apvalb6c0w9hltQ8AOTF4go23(userUIDby)/Order(subcollectionName)/7WqHl5YUKPszkRELXEI2(auto-id)

So Customer is a collectionName, cl0Apvalb6c0w9hltQ8AOTF4go23(USERUID) is a USER-UID for a user. Authentication, Order another collectionName, and 7WqHl5YUKPszkRELXEI2 is an auto-id for an added order.

In this each user can GET its own data but as Admin I want to get to see all user data.

I want All FIRESTORE data of users to display on angular as I am making an admin panel in angular 12.

export class OrderlistsService {

    itemsCollection!: AngularFirestoreCollection<Item>;

    items!: Observable<Item[]>;

    itemDoc!: AngularFirestoreDocument<Item>;

    constructor(private firestore: AngularFirestore) {}

    getOrdersItems() {
       return this.firestore.collection<Item>('customer').valueChanges();
    }}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you want to load all users' orders, you're looking for a collection group query . In AngularFire that would be:

 import { collectionGroup, query, where, getDocs } from "firebase/firestore"; this.firestore.collectionGroup<Item>('Order').valueChanges();

This reads documents from all subcollections named Order , no matter where they are in your database.

over 4 years ago · Santiago Trujillo 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