Skip to content

Add updateIfExists and/or update #55

Open
@Treora

Description

I have the common scenario that I want to update a field in a document (e.g. when some async calculation completes), if that document still exists. upsert is almost suitable, except that it would recreate the document instead of ignoring or failing.

So I propose to create either (or both):

  • a function updateIfExists, that would be like upsert but fail silently if the document does not exist. I think fits nicely as a dual to putIfNotExists.
  • a function update; same idea, but it would fail loudly instead of silently (perhaps better, since it gives the choice whether to ignore the failure).

I'd be happy to provide a PR if you would agree on adding such an extra function (tell me which would be preferred).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions