update method
Updates the fields in data of the document. Each key is a field path: a String (dots separate nested
fields) or a FieldPath. Fails with FirestoreErrorCode.notFound if the document does not exist.
Implementation
Future<void> update(Map<Object, Object?> data) async {
final UserDataParsedUpdateData parsed = firestore.dataConverter
.parseUpdateMap(
data,
methodName: 'DocumentReference.update',
targetDoc: key,
);
return _commit(parsed.toMutation(key, Precondition(exists: true)));
}