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

176
Visualizações
Firestore collection listeners enormous number of reads

I am implementing Firestore data storage in one of my apps.

I have a listener which follows updates in the "logs" collection like so:

db.collection("logs").addSnapshotListener({ (snapshot, error) in
    guard let s = snapshot else {return}
    if s.metadata.isFromCache {
        print("LOG_C \(s.documentChanges.count)")
            return
    }
    print("LOG \(s.documentChanges.count)")
    // other code
})

During testing, I've been uploading documents to this collection and then I removed all of them through Firebase console. So, right now, the collection doesn't exist for my test user. When I launch the app for the first time, I do see that this collection is empty - the listener reports the correct result.

However, in doing so, it consumes roughly 1000 reads. It almost feels like it is downloading all the history of this collection for my test user (e.g. 500 docs inserted, 500 docs deleted). However, even if it does, it does not report it to me - I receive only one "LOG 0" message in the console.

Is this how collection listeners work? I do know that listeners download the initial state, but I thought that it would be the current snapshot which, in this case, would consume 1 read to determine that there is nothing to return initially.

Any explanations/ideas/suggestions are welcome.

I would very much like to debug this by viewing detailed Firestore read logs. However, I cannot find such option in the console :(

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In this case, it sounds as if the OP left the Firestore console open while performing database operations. Since the Firestore console itself reflects realtime updates, it will incur reads over time as the currently selected collection changes.

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