
MongoDB Load
CertifiedBulk insert documents from internal storage
MongoDB Load
Bulk insert documents from internal storage
Reads a Kestra internal storage file of JSON/BSON records and inserts them with MongoDB bulkWrite. Inherits chunking (default 1000). Optionally derives _id from a field and removes that field.
type: io.kestra.plugin.mongodb.LoadExamples
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-dynamic
MongoDB connection properties
io.kestra.plugin.mongodb.MongoDbConnection
Connection string to MongoDB server
URL format like mongodb://mongodb0.example.com: 27017
database *Requiredstring
MongoDB database
from *Requiredstring
Source file
Path in internal storage (kestra://...) containing BSON or JSON documents to stream into MongoDB.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
chunk integerstring
1000Bulk chunk size
Number of write models sent per bulkWrite call; defaults to 1000.
idKey string
Field used as _id
If set, value is converted to ObjectId and stored as _id.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
removeIdKey booleanstring
trueRemove idKey field
When true (default), drops the source field after copying it to _id.
Outputs
deletedCount integer
0Deleted documents
Documents removed by bulk delete models.
insertedCount integer
0Inserted documents
Count of documents created by bulk writes.
matchedCount integer
0Matched documents
Documents matched by update or replacement models.
modifiedCount integer
0Modified documents
Documents updated by bulk operations.
size integer
Rows processed
Total records read from the source file.
Metrics
records counter
countNumber of documents processed in the bulk operation
requests.count counter
countNumber of bulk requests sent to MongoDB