googleapis / googleapis/google-cloud-node

Support optimistic transactions as an option

Open
#7,489 2 comments 1 reaction 0 assignees View on GitHub
api: firestore library: nodejs-firestore type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

**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.

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.