-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SetOptions needs IfMatch #7470
Comments
Just to check, all of this is about the Firestore libraries, right? (This repository is the home of over 100 libraries.) Note that the library can only expose what's in the underlying gRPC API, and I don't think what you're asking for is in the underlying API. The last update time is available when you read a document, yes - so I'd expect to use I would suggest that this is probably something to describe with the Firestore team directly rather than here, as it's an API feature request rather than being specific to the .NET client library. |
Oh hey Jon, sorry yes: Firestore libraries it is. I didn't realise it's gRPC underneath. I'll have a look and see if I can find the Firestore team on here. Thanks for the prompt answer. |
Okay I've found a form through which I can submit a feature request. I'll do that. Close this if you think we're done. |
Yup, thanks. Obviously if it gets exposed, we'll implement it in the C# library :) |
Is your feature request related to a problem? Please describe.
I'm researching GCP products for a move from Azure. My code assumes ETags/row-versions are a thing generally when persisting data, i.e. that the concept is transferrable across products in software engineering. I see that Firestore's REST API returns an ETag and supports conditional requests via
if-match
.However, I cannot see this functionality surfaced via the .NET C# library. I have checked the
SetOptions
andPrecondition
classes but nothing; it seemsLastUpdateTime
is the only option.Note - I assume the current last update time is made available easily in the document when it's read, so I can easily use it in the subsequent update. If not, then that's a feature request.
Note - I assume the current ETag is also made available easily in the document when it's read. If not, then that too is a feature request.
I regard conditional updates based on unique version to be a critical feature of any database. I also think these values play an important role in distributed architectures and microservices where services maintain their own copies of data from remote services; the ETag of the remote data is critical for failing local conditional updates. It's complicated, but trust me.
Describe the solution you'd like
I'd like
Precondition.IfMatch
and/orSetOptions.IfMatch
available.Describe alternatives you've considered
Noting my assumption above, the alternative is a far more invasive refactor of my code, which risks making it incompatible with other stores that use ETags/row-versions.
Else I could add a row-version field to all my documents but this would need a
findAndModify
sort of method like that found in MongoDB, or anupdate ... where
in T-SQL.Additional context
Functionality exposed in REST API.
https://firebase.google.com/docs/reference/rest/database#section-cond-ifmatch
Blog, announcement, fanfare, 4 years ago.
https://firebase.googleblog.com/2017/07/introducing-conditional-rest-requests.html
The text was updated successfully, but these errors were encountered: