replace method
Replaces the document at docId
with value
.
If no document exists yet, the replace will fail silently.
Requires 1 read of doc to perform replace
Implementation
@override
Future<void> replace({required DocumentId docId, required T value}) async {
await _addToBatch((batch) async {
final existingDoc = await collection.read(docId);
if (existingDoc == null) return;
batch.set(collection.ref.doc(docId.docId), value);
});
}