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

130
Vistas
Firestore Batch writes get rollbacked like Transaction does?

Trying to write more than 500 documents using Firestore Batch. And I'm wondering if all the batch writes get rollbacked automatically if any batch write fails. If not, how can I achieve that, is there any way to overcome the 500 writes limit with Transaction.

  const BATCH_CHUNK = 500
  const batches = []
  for (let i = 0; i < snapshot.docs.length; i += BATCH_CHUNK) {
    const batch = db.batch()
    snapshot.docs.slice(i, i + BATCH_CHUNK).forEach(doc => {
      batch.update(doc.ref, { committed: true })
    })
    batches.push(batch.commit())
  }

  await Promise.all(batches)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Batch writes are executed atomically indeed. If one of the writes gets rejected by say security rules, the other writes in that batch are rejected too. So either all writes in a batch are committed, or none of them are.

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