update method

WriteBatch update(
  1. DocumentReference documentRef, {
  2. Map<String, dynamic>? data,
  3. List? fieldsAndValues,
})

Updates fields in the document referred to by this DocumentReference. The update will fail if applied to a document that does not exist.

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

The DocumentReference parameter is a reference to the document to be updated. Value must not be null.

The data param is the Map containing all of the fields and values to update.

The fieldsAndValues param is the List alternating between fields (as String or FieldPath objects) and values.

Returns non-null WriteBatch instance used for chaining method calls.

Implementation

WriteBatch update(
  DocumentReference documentRef, {
  Map<String, dynamic>? data,
  List< /*String|FieldPath|dynamic*/ dynamic>? fieldsAndValues,
}) =>
    WriteBatch.getInstance(_wrapUpdateFunctionCall(
        jsObject, data, fieldsAndValues, documentRef));