FR: Add precondition support to 'set' methods #1286
Labels
api: firestore
Issues related to the googleapis/java-firestore API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
The 'update' methods of UpdateBuilder and DocumentReference support a Precondition parameter, while 'set' methods do not, even though they use the same underlying server API, which supports preconditions.
I suggest adding precondition support to 'set' methods as well, as that would be useful for cases where you want to replace a document, unless it has been modified elsewhere since you loaded it.
I have implemented a POC of this feature, and tested that it works. I would be happy to submit a PR.
The text was updated successfully, but these errors were encountered: