Skip to content

FR: Expose "create" precondition for firestore writes #1324

@ribrdb

Description

@ribrdb

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions