Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda