-
Notifications
You must be signed in to change notification settings - Fork 38
Description
The node.js API for DocumentReference.update allows an optional second argument, Preconditions. This is missing from the firebase-admin-interop implementation.
The Dart package implements the Precondition object, documents it as used in Transaction, DocumentReference, and WriteBatch, but it is only available in the Transaction.update call, not the other two.
The firestore_binding js DocumentReference collection seems to declare the JS call with the correct arguments:
external Promise update(UpdateData data, [Precondition precondition]);
So it seems like the Dart DocumentReference implementation could just call
nativeInstance.update(docData, _getNativePrecondition(lastUpdateTime))
in the case that an optional Timestamp is passed to it, as is the case with Transaction.
I would like to update documents from DocumentReference, but be sure that I am not overwriting other's changes.