Skip to main content

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​

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 fields to patch. For each input:
  • NameField name to be updatedString
  • 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

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