
DocumentDB Read
CertifiedRead documents from DocumentDB
DocumentDB Read
Read documents from DocumentDB
Query a collection with an optional filter, skip/limit, or aggregation pipeline. Results are rendered into the selected fetchType output; default FETCH returns all rows.
type: io.kestra.plugin.documentdb.ReadExamples
Find all users
id: read_all_users
namespace: company.documentdb
tasks:
- id: find_users
type: io.kestra.plugin.documentdb.Read
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
fetchType: FETCH
Find users with filter and limit
id: find_active_users
namespace: company.documentdb
tasks:
- id: find_filtered_users
type: io.kestra.plugin.documentdb.Read
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
filter:
status: "active"
age:
$gte: 18
limit: 100
fetchType: FETCH
Get single user
id: get_single_user
namespace: company.documentdb
tasks:
- id: find_one_user
type: io.kestra.plugin.documentdb.Read
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
filter:
email: "john.doe@example.com"
fetchType: FETCH_ONE
Aggregation pipeline example
id: user_statistics
namespace: company.documentdb
tasks:
- id: aggregate_users
type: io.kestra.plugin.documentdb.Read
connectionString: "{{ secret('DOCUMENTDB_CONNECTION_STRING') }}"
database: "myapp"
collection: "users"
aggregationPipeline:
- $match:
status: "active"
- $group:
_id: "$department"
count: { $sum: 1 }
avgAge: { $avg: "$age" }
- $sort:
count: -1
fetchType: FETCH
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.
aggregationPipeline array
Aggregation pipeline
MongoDB aggregation stages to run instead of a simple find. Overrides filter, skip, and limit.
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://
fetchType string
FETCHSTOREFETCHFETCH_ONENONEFetch type
Controls result handling (default FETCH). STORE writes all rows to Kestra internal storage as ION, FETCH outputs all rows, FETCH_ONE outputs only the first row, NONE skips output.
filter object
Filter
MongoDB-style filter for the find query, rendered at runtime. Leave empty to scan the full collection.
limit integerstring
Limit
Maximum number of documents to return; optional server-side cap.
skip integerstring
Skip
Number of documents to skip before returning results.
Outputs
row object
First row
First matching document when fetchType is FETCH_ONE; null if no results.
rows array
Rows
All returned documents when fetchType is FETCH.
size integer
Returned document count
Number of documents returned by the query, including when fetchType is NONE and results are not output.
uri string
uriResult file URI
URI in Kestra internal storage for the ION result file; only set when fetchType is STORE.