
MongoDB Find
CertifiedQuery documents from MongoDB
MongoDB Find
Query documents from MongoDB
Executes find on a collection with optional projection, sort, skip, and limit. Filter/projection/sort accept BSON strings or maps rendered from Flow variables. Results are fetched in-memory by default or stored as Ion in internal storage when store is true.
type: io.kestra.plugin.mongodb.FindExamples
id: mongodb_find
namespace: company.team
tasks:
- id: find
type: io.kestra.plugin.mongodb.Find
connection:
uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
filter:
_id:
$oid: 60930c39a982931c20ef6cd6
Find documents in MongoDB based on a filter condition using MongoDB Query Language.
id: filter_mongodb
namespace: company.team
tasks:
- id: filter
type: io.kestra.plugin.mongodb.Find
connection:
uri: mongodb://host.docker.internal:27017/
database: local
collection: pokemon
store: true
filter:
base_experience:
$gt: 100
Properties
collection *string
MongoDB collection
connection *
MongoDB connection properties
io.kestra.plugin.mongodb.MongoDbConnection
Connection string to MongoDB server
URL format like mongodb://mongodb0.example.com: 27017
database *string
MongoDB database
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
{}1150filter object
Query filter
BSON string or map rendered before execution.
limit integerstring
Limit
Maximum documents returned.
projection object
Projection
BSON string or map selecting fields to return.
skip integerstring
Skip
Documents to skip before returning results.
sort object
Sort
BSON string or map defining sort order.
store booleanstring
falseStore results
When true, writes results as Ion to internal storage; otherwise returns rows. Defaults to false.
Outputs
rows array
Result rows
Present when store is false.
size integer
Rows fetched
uri string
uriStored result URI
Internal storage URI when store is true.
Metrics
records counter
countNumber of documents fetched from MongoDB