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
| Field | Description | Type / Options | 
|---|---|---|
| Label | Custom name for the action | String | 
| Document ID | The unique _idof the MongoDB document to update | String | 
| Collection Name | Target MongoDB collection where the document resides | String | 
| Select connection | Choose or create a MongoDB database connection | Connection | 
| Inputs | Key-value pairs representing the new document content. For each input: | |
| • Name | Field name to be updated or replaced | String | 
| • Path | JSON path for nested fields (optional) | String | 
| • Type | Data type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY) | Dropdown | 
| • Value | The new value to set for the specified field | Dynamic / Static | 
| Outputs – Truncate Fields | Toggle to truncate long field values in the output (optional) | Boolean | 
| Schema | Optional: Select a schema to validate and shape the updated document | Schema | 
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