nodejs-firestore icon indicating copy to clipboard operation
nodejs-firestore copied to clipboard

Support optimistic transactions as an option

Open merlinnot opened this issue 5 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I found that for some usage patterns optimistic transactions would work better than pessimistic.

Describe the solution you'd like

I'd like to pass an option to runTransaction which would allow me to choose if pessimistic or optimistic transactions should be used.

Describe alternatives you've considered

There are workarounds for it, like manually fetching documents, checking preconditions, then starting a transaction and reading the documents again, but I find it unnecessarily verbose and having an optimistic transaction would make my code simpler.

Additional context

None.

merlinnot avatar May 26 '20 16:05 merlinnot

@merlinnot Thanks for filing this. This is something we can consider for a future release, but we will likely need additional customer requests before we can prioritize this work internally.

schmidt-sebastian avatar May 26 '20 16:05 schmidt-sebastian

Sure thing, I don't expect it to happen any time soon. Good to have it on the radar though.

merlinnot avatar May 26 '20 16:05 merlinnot