
DocumentDB Update
CertifiedUpdate documents in DocumentDB
DocumentDB Update
Update documents in DocumentDB
Apply Mongo-style update operators to matching documents. Defaults to updating one document; set updateMany to true to affect all matches. An empty filter with updateMany can update every document.
type: io.kestra.plugin.documentdb.UpdateExamples
Update a single user document
id: update_documentdb_user
namespace: company.documentdb
tasks:
- id: update_user
type: io.kestra.plugin.documentdb.Update
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
filter:
email: "john.doe@example.com"
update:
$set:
status: "active"
last_login: "{{ now() }}"
updateMany: false
Update multiple documents
id: update_multiple_users
namespace: company.documentdb
tasks:
- id: update_inactive_users
type: io.kestra.plugin.documentdb.Update
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
filter:
last_login:
$lt: "2023-01-01"
update:
$set:
status: "inactive"
archived_date: "{{ now() }}"
updateMany: true
Update with increment operation
id: increment_user_views
namespace: company.documentdb
inputs:
- id: user_id
type: STRING
defaults: user-123
tasks:
- id: increment_views
type: io.kestra.plugin.documentdb.Update
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "profiles"
filter:
user_id: "{{ inputs.user_id }}"
update:
$inc:
view_count: 1
total_interactions: 1
$set:
last_viewed: "{{ now() }}"
updateMany: false
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-documentdb --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
collection *string
Target collection
Collection name used for the operation; expressions are rendered at runtime.
database *string
Target database
Database name used for the operation; expressions are rendered at runtime.
update *object
Update operations
Required MongoDB update document (e.g., $set, $inc), rendered before sending to the API.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150caCertificate string
CA certificate
PEM-encoded CA certificate used to verify the TLS connection to DocumentDB.
connectionString string
Amazon DocumentDB connection string
Recommended connection URI for Amazon DocumentDB, consumed by the MongoDB Java Driver, for example: mongodb://
filter object
Filter query
MongoDB-style filter that selects documents to update. Rendered at runtime; an empty filter with updateMany updates all documents.
updateMany booleanstring
falseUpdate all matches
Set to true to update every document matching the filter; default false updates only the first match.
Outputs
matchedCount integer
Matched document count
Number of documents that matched the filter.
modifiedCount integer
Modified document count
Number of documents actually updated.
upsertedId string
Upserted document ID
ID of the inserted document when upsert occurs; null otherwise.