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

160
Vistas
Firestore: query for doc subcollection size

I have Project docs that have Items subcollections. Now I want to fetch all projects that have at least one item in their subcollection. Is that possible?

Something like:

getDocs(collection(getDB(), "Projects"), where("Items.size",">",0);

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

0

This is not possible with Firestore. What you should do instead is maintain a separate integer field in the document that tracks the size of the Items subcollection so that you can query it separately. You will need to make sure that any changes to the Items subcollection result in changes to that new field that tracks its size.

See also:

  • Cloud Firestore collection count
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