Patch
MongoDB Plugin – Patch Action
Summary (SEO Meta Description):
The Patch Action of the MongoDB Plugin updates specific fields of a document without replacing the entire object.
It enables workflows to make partial updates to stored data efficiently.
Overview
The Patch Action allows your workflow to modify only selected fields within an existing MongoDB document.
This is especially useful when you need to update a few attributes without overwriting the whole record.
Typical Use Cases:
- Update a customer’s email or phone number without affecting other details
- Modify product stock quantity after a sale
- Update a single configuration parameter in a large settings document
- Correct a typo in a user profile field
⚙️ 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 fields to patch. For each input: | |
| • Name | Field name to be updated | 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 | 
FAQ
Q: What if the document ID is not found?
A: No changes will be made. The action completes without updating any document.
Q: Can I patch multiple fields at once?
A: Yes. Add multiple inputs to update several fields in a single action.
Q: Does Patch overwrite the whole document?
A: No. It only updates the specified fields and leaves the rest of the document unchanged.
Keywords: WeHub MongoDB Plugin, MongoDB Patch Action, Partial Document Update, NoSQL Workflow Automation