Find documents in a MongoDB collection.
type: "io.kestra.plugin.mongodb.Find"
Examples
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 *Requiredstring
MongoDB collection.
connection *RequiredNon-dynamicMongoDbConnection
MongoDB connection properties.
database *Requiredstring
MongoDB database.
filter object
MongoDB BSON filter.
Can be a BSON string or a map.
limit integerstring
The number of records to return.
projection object
MongoDB BSON projection.
Can be a BSON string or a map.
skip integerstring
The number of records to skip.
sort object
MongoDB BSON sort.
Can be a BSON string or a map.
store booleanstring
false
Whether to store the data from the query result into an ion serialized data file.
Outputs
rows array
List containing the fetched data.
Only populated if store
parameter is set to false.
size integer
The number of rows fetched.
uri string
uri
URI of the file containing the fetched results.
Only populated if store
parameter is set to true.
Definitions
io.kestra.plugin.mongodb.MongoDbConnection
uri *Requiredstring
Connection string to MongoDB server.
URL format like mongodb://mongodb0.example.com: 27017