update document
This block is part of the storage group and was last modified in core v15.0.0.
Storage Selection Required
This block relies on a storage to perform its storage releated actions. You must manually select the storage you want to use in your flow using the storage selector modal. To access the modal, click the white button on the block.
update document v9.2.5 Updated v15.0.0Update document in the given storage and creates a revision for it.
- flow
flow - guid required
v9.2.5valueThe documents GUID (unique ID) to update. • Hidden when other fields are filled
- GUID seed
v15.0.0valueOptional fallback when
guidis not connected: derives the document GUID from this seed exactly likecreate document'sguid_seed(the sha256 of the seed), so a create/update pair wired to the same raw seed always addresses the same document. Always wire the RAW seed : never the output of thegenerate guidblock, which is already a hash and would be hashed again. • Hidden when other fields are filled - mutations required
mutationsProvide the mutations for this document. e.g. use
set fieldsto set existing/update fields. - expiry
dateWhen a document is given an expiry date, the document will be unrecoverably deleted on the given date
- options
objectOptions can be given e.g.
skip_revisionsto skip create revisions for high-update docs,skip_on_savedto skip the on-events for this document update,skip_removedto skip removed document checks. - update priority
v13.0.6numberA document update can be important for search relevance or not, by poviding the system a priority you can help it understand what updates are high priority (1) and what updates can be delayed without huge impact for search relevance (3). 1 is highest priority, 2 is medium priority, 3 is low priority and 0 is wait-for-insert.
- Storage required
storageThe storage this document is currently stored in.
- flow
flow - success
condition - guid
value - document
object - timestamp
v12.0.0numbertimestamp in ms, can be used to wait for the document to be available in search.
- error
value - has changes
v13.0.9conditionReturns
trueif the document had any changes, as the block can return success for non-updated documents due to the happy flow.
Applies the mutations to the document addressed by guid : falling back to guid_seed (sha256 of the raw seed, same as create document) and then to the deprecated object pin's _meta.guid : and outputs the updated document, its guid, and timestamp in ms. No resolvable GUID gives error MISSING_GUID; missing storage MISSING_STORAGE; a failed update gives success=false, an empty object and timestamp=-1. has_changes=false when the update succeeded but effectively changed nothing, so success=true does not imply a modification. Simulation applies the mutations in memory and reports success without writing.
The flow loads a document with get document, reads a field with get fields, turns it into mutations with set fields, and update document writes them back. The success pin then drives a branch.
Commonly used with
In production blueprints, this block is most often wired together with:
- branch: wired in both directions with this block.
- set fields: feeds into this block. Generates an array of mutations based on the given filled fields.
- get fields: wired in both directions with this block. Gets the selected fields from the given object.
- reply in JSON: this block feeds into it. Reply to any httpconnection as JSON body.
- get document: feeds into this block. get a specific document based on the given GUID.
- create: feeds into this block. Creates a new function that can be executed using the given name.
Used in these guides
These documentation pages use or explain this block:
- Creating a REST API
- Common Blueprint Patterns
- Object References and Copies
- Storage Examples
- Storages
- Example: E-Commerce Catalog
- Example: Simple Blog
- Build Your First CRUD App
Version history
Introduced in v9.2.5.
Last modified in v15.0.0.
v13.0.9, click here to see the release notes. v13.0.6 This block or one of its pins was updated in v13.0.6, click here to see the release notes. v12.0.0 This block or one of its pins was updated in v12.0.0, click here to see the release notes. v10.2.9 This block or one of its pins was updated in v10.2.9, click here to see the release notes. Back to
storage Return to the main group to view all sub-groups Back to storage Return to the group to view all blocks within this group 