firebase / firebase/firebase-js-sdk

FR: Expose "create" precondition for firestore writes

Open
#1,324 2 comments 0 reactions 0 assignees View on GitHub
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

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.