Read
Read documents from DocumentDB
Read
Read documents from DocumentDB
yaml
type: io.kestra.plugin.documentdb.ReadExamples
yaml
id: read_all_users
namespace: company.documentdb
tasks:
- id: find_users
type: io.kestra.plugin.documentdb.Read
host: "https://my-documentdb-instance.com"
database: "myapp"
collection: "users"
username: "{{ secret('DOCUMENTDB_USERNAME') }}"
password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
fetchType: FETCH
yaml
id: find_active_users
namespace: company.documentdb
tasks:
- id: find_filtered_users
type: io.kestra.plugin.documentdb.Read
host: "https://my-documentdb-instance.com"
database: "myapp"
collection: "users"
username: "{{ secret('DOCUMENTDB_USERNAME') }}"
password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
filter:
status: "active"
age:
$gte: 18
limit: 100
fetchType: FETCH
yaml
id: get_single_user
namespace: company.documentdb
tasks:
- id: find_one_user
type: io.kestra.plugin.documentdb.Read
host: "https://my-documentdb-instance.com"
database: "myapp"
collection: "users"
username: "{{ secret('DOCUMENTDB_USERNAME') }}"
password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
filter:
email: "john.doe@example.com"
fetchType: FETCH_ONE
yaml
id: user_statistics
namespace: company.documentdb
tasks:
- id: aggregate_users
type: io.kestra.plugin.documentdb.Read
host: "https://my-documentdb-instance.com"
database: "myapp"
collection: "users"
username: "{{ secret('DOCUMENTDB_USERNAME') }}"
password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
aggregationPipeline:
- $match:
status: "active"
- $group:
_id: "$department"
count: { $sum: 1 }
avgAge: { $avg: "$age" }
- $sort:
count: -1
fetchType: FETCH
Properties
collection *Requiredstring
database *Requiredstring
host *Requiredstring
password *Requiredstring
username *Requiredstring
aggregationPipeline array
SubTypeobject
fetchType string
Default
FETCHPossible Values
STOREFETCHFETCH_ONENONEfilter object
limit integerstring
skip integerstring
Outputs
row object
rows array
SubTypeobject
size integer
uri string
Format
uri