update method

Transaction update(
  1. DocumentReference<Object?> docRef,
  2. Map<String, dynamic> data
)

Queues an update operation for the given document.

Parameters:

  • docRef: The document reference.
  • data: The fields to update.

Returns: The Transaction instance for chaining.

Example:

transaction.update(docRef, {'field': 'new value'});

Implementation

Transaction update(DocumentReference docRef, Map<String, dynamic> data) {
  if (__status == -1) {
    throw Utils.oracledbErrorHandler(400, OracledbErrorMessages.transactionEnded, null);
  }
  __operations.add({
    "method": "update",
    "docRef": docRef,
    "data": data,
    "options": null,
    "version": __versions[docRef.path]
  });

  return this;
}