googleapis / googleapis/google-cloud-java

[java-firestore] FR: Add precondition support to 'set' methods

Open
#13,121 4 comments 0 reactions 1 assignee Claimed by @dconeybe View on GitHub
api: firestore type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.