Class WriteBatch

java.lang.Object
com.codename1.cloud.firebase.WriteBatch

public final class WriteBatch extends Object

A group of writes applied atomically by Firestore.commit(WriteBatch).

Paths are relative to the database root, such as cities/SF.

  • Constructor Details

    • WriteBatch

      public WriteBatch()
  • Method Details

    • set

      public WriteBatch set(String path, Map<String,Object> data)

      Replaces or creates a document.

      Parameters
      • path: the document path

      • data: the full contents

      Returns

      this batch

    • update

      public WriteBatch update(String path, Map<String,Object> data)

      Updates only the given fields of an existing document.

      Parameters
      • path: the document path

      • data: the fields to change

      Returns

      this batch

    • delete

      public WriteBatch delete(String path)

      Deletes a document.

      Parameters
      • path: the document path
      Returns

      this batch

    • size

      public int size()
      Returns

      the number of queued writes