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

106
Vistas
Firestore listen only to root component

Please take a look at this example: enter image description here

As you see I have a collection called "new_letters" and inside there I have documents, which also have collections and in those also documents, so basicly a long chain of data segments always.

My goal would be to have a listener which checks the amount of documents inside of "new_letters" and my idea would be the simple one following:

var counter = firebase.firestore().ref("new_letters").onSnapshot(snapshot => {
   return snapshot.size
});

My problems are the following:

  • Im afraid of long bills and therefore I only want to check the amount of the data, not every subcollection of subdocument included in the collection "new_letters". If I do the listener like above, will I only download the 3 documents or will this also include the "inbox"-collection which is inside of the second document for example?
  • Incase Point 1 is true and I download all data, including each "inbox" inside every document in "new_letters", is the only alternative making a counter for example in the firebase.database() and listening only to that?

Im looking for a solution which is the least recource-consuming.

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