PATCH
CosmosDB NoSQL Plugin – Patch Action
Summary (SEO Meta Description):
The Patch Action of the CosmosDB NoSQL Plugin updates specific fields of existing documents in an Azure Cosmos DB container without replacing the entire document.
Use it for partial updates to optimize performance and reduce data transfer.
Overview
The Patch Action allows your WeHub workflow to modify only selected fields in a Cosmos DB document.
This is ideal when you want to apply small, targeted updates instead of replacing the full document.
Typical Use Cases:
- Incrementing counters or numeric fields
- Updating user profile attributes without touching other fields
- Patching configuration flags or feature toggles
- Reducing network and compute cost for frequent small updates
⚙️ Configuration
| Field | Description | Type / Options | 
|---|---|---|
| Label | Custom name for the action | String | 
| Select connection | Choose or create a secure connection to Azure Cosmos DB | Connection | 
| Partition Key | Specify the partition key value for the targeted document | String | 
| Container name | Select the target container where the document resides | Dropdown | 
| Columns → Map | Define the columns (fields) to patch and their new values | Name/Value pairs (types: Number, String, Byte, Date, DateTime, Boolean, Object, Array, Any) | 
| Inputs (optional) | Provide dynamic input values to be used in the patch operation | Manual toggle | 
| Schema (optional) | Select an input/output schema if you need structured validation | Schema | 
| Outputs (optional) | Define and map the expected output fields after the patch operation | Manual toggle | 
| Truncate Fields | Optionally truncate output fields to a defined level | Toggle + Truncate Level | 
FAQ
Q: What is the difference between Patch and Update?
A: Patch modifies only specified fields, while Update typically replaces or updates the entire document content.
Q: Can I patch multiple documents at once?
A: The action operates per document based on the given partition key and query parameters.
Q: Will the action create new fields if they do not exist?
A: Yes, Patch can create the specified fields if they are not already present in the document.
Keywords: WeHub CosmosDB NoSQL Plugin, Patch Action, Partial Document Update, Azure Cosmos DB, NoSQL Patch, CosmosDB Workflow Integration