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

175
Vistas
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 Respuestas
Responde la pregunta

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 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