Skip to main content

Update

MongoDB Plugin – Update Action

Summary (SEO Meta Description):
The Update Action of the MongoDB Plugin replaces or modifies an existing document with new values.
It enables workflows to fully update a document’s content based on its unique identifier.


Overview

The Update Action allows your workflow to replace or overwrite an existing document in a MongoDB collection using its Document ID.
Use it when you want to refresh a record with a new version or make comprehensive changes to its content.

Typical Use Cases:

  • Overwrite a product record when updating catalog data
  • Replace a user profile with the latest information from an external system
  • Refresh a configuration document after major system updates
  • Synchronize complete records from an upstream data source

⚙️ Configuration

FieldDescriptionType / Options
LabelCustom name for the actionString
Document IDThe unique _id of the MongoDB document to updateString
Collection NameTarget MongoDB collection where the document residesString
Select connectionChoose or create a MongoDB database connectionConnection
InputsKey-value pairs representing the new document content. For each input:
  • NameField name to be updated or replacedString
  • PathJSON path for nested fields (optional)String
  • TypeData type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)Dropdown
  • ValueThe new value to set for the specified fieldDynamic / Static
Outputs – Truncate FieldsToggle to truncate long field values in the output (optional)Boolean
SchemaOptional: Select a schema to validate and shape the updated documentSchema

FAQ

Q: Does Update replace the entire document?
A: Yes. The Update Action is intended to replace the document’s fields with the provided inputs.
For partial updates use the Patch Action.

Q: What if the document ID does not exist?
A: No update is performed and the action completes without error.

Q: Can I validate the updated document?
A: Yes. Use the Schema option to ensure the final document structure matches your expectations.


Keywords: WeHub MongoDB Plugin, MongoDB Update Action, Replace Document, NoSQL Workflow Automation