update method

  1. @override
Future<void> update([
  1. DocumentReference<Object?>? refe
])
override

If refe is provided, it sets the ref to the new reference. Also updates all duplicates.

Implementation

@override
Future<void> update([refe]) async {
  if (!isMainObject) {
    throw 'Only main object can update';
  }
  await super.update(refe);
  // Update duplicates
  await Future.wait(duplicateRefs.map((e) => e.set(toMap())));
}