firebase / firebase/firebase-js-sdk
FR: Expose "create" precondition for firestore writes
Open
api: firestore
feature request
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
It should be possibly to do a write that fails if the document already exists, like is possible in the admin sdk.
Instead I have to do something like:
1) Read the document
2) If it doesn't exist, read it again in a transaction
3) If it exists now do a dummy update so the transaction can succeed, otherwise create it.
Contributor guide
Assessment
This issue has not been assessed yet.