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

220
Vistas
how to search in sub collection with firebase firestore

I want to search in all sub-collections in firebase

  return database
    .collection("students")
    .doc(/* usually I pass the student id here but want to get exams for all students */)
    .collection("exams")
    .where("score", ">=", 4)
    .get()

is this possible to do? is too late to change my database and store exams in one collection and students in another one. unfortunately. thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To search across multiple collections in Firestore you can use a collection group query, which queries all collections with a specific name.

So if you want to search the exams subcollections of all students, that'd be:

database
    .collectionGroup("exams")
    .where("score", ">=", 4)
    .get()
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