Bulk load documents into a MongoDB using Kestra’s internal storage file.
type: "io.kestra.plugin.mongodb.Load"Examples
id: mongodb_load
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: load
type: io.kestra.plugin.mongodb.Load
connection:
uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
from: "{{ inputs.file }}"
Properties
collection *Requiredstring
MongoDB collection.
connection *RequiredNon-dynamicMongoDbConnection
MongoDB connection properties.
database *Requiredstring
MongoDB database.
from *Requiredstring
The source file.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
chunk integerstring
1000Chunk size for every bulk request.
idKey string
Use this key as ID.
removeIdKey booleanstring
trueWhether to remove idKey from the final document.
Outputs
deletedCount integer
0The number of documents deleted by the write operation.
insertedCount integer
0The number of documents inserted by the write operation.
matchedCount integer
0The number of documents matched by updates or replacements in the write operation.
modifiedCount integer
0The number of documents modified by the write operation.
size integer
The number of rows processed.
Definitions
io.kestra.plugin.mongodb.MongoDbConnection
uri *Requiredstring
Connection string to MongoDB server.
URL format like mongodb://mongodb0.example.com: 27017