update method

WriteBatch update(
  1. DocumentReference documentRef,
  2. JSObject data, [
  3. Precondition precondition
])

Update fields of the document referred to by the provided DocumentReference. If the document doesn't yet exist, the update fails and the entire batch will be rejected.

Nested fields can be updated by providing dot-separated field path strings.

@param documentRef A reference to the document to be updated. @param data An object containing the fields and values with which to update the document. @param precondition A Precondition to enforce on this update. @throws Error If the provided input is not valid Firestore data. @return This WriteBatch instance. Used for chaining method calls.

Implementation

external WriteBatch update(
  DocumentReference documentRef,
  JSObject data, [
  Precondition precondition,
]);