Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class WriteBatch

  1. Object
  2. WriteBatch

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

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

Constructors

public WriteBatch()

Methods

public WriteBatch set(String path, Map<String, Object> data)Replaces or creates a document.
public WriteBatch update(String path, Map<String, Object> data)Updates only the given fields of an existing document.
public WriteBatch delete(String path)Deletes a document.
public int size()

Inherited methods

Constructor details

WriteBatch

public WriteBatch()

Method details

set

public WriteBatch set(String path, Map<String, Object> data)
Replaces or creates a document.

Parameters

path String
the document path
data Map<String, Object>
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 String
the document path
data Map<String, Object>
the fields to change

Returns

this batch

delete

public WriteBatch delete(String path)
Deletes a document.

Parameters

path String
the document path

Returns

this batch

size

public int size()

Returns

the number of queued writes