Skip to main content

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

FieldDescriptionType / Options
LabelCustom name for the actionString
Select connectionChoose or create a secure connection to Azure Cosmos DBConnection
Partition KeySpecify the partition key value for the targeted documentString
Container nameSelect the target container where the document residesDropdown
Columns → MapDefine the columns (fields) to patch and their new valuesName/Value pairs (types: Number, String, Byte, Date, DateTime, Boolean, Object, Array, Any)
Inputs (optional)Provide dynamic input values to be used in the patch operationManual toggle
Schema (optional)Select an input/output schema if you need structured validationSchema
Outputs (optional)Define and map the expected output fields after the patch operationManual toggle
Truncate FieldsOptionally truncate output fields to a defined levelToggle + 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