update method

Future<void> update (
  1. {Map<String, Object> data,
  2. Reach reach: Reach.regional}
)

Updates the document.

If the document does not exist, the method will throw DatabaseException.notFound.

Optional parameter reach can be used to specify the minimum level of authority needed. For example:

  • Reach.local tells that the write only needs to reach the local database (which may synchronized with the global database later).
  • Reach.global tells that the write should reach the global master database.

Implementation

Future<void> update({
  Map<String, Object> data,
  Reach reach = Reach.regional,
}) async {
  return DocumentUpdateRequest(
    document: this,
    data: data,
    isPatch: false,
    reach: reach,
  ).delegateTo(parentDatabase.adapter);
}