MongoDB Load

MongoDB Load

Certified

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.

yaml
type: io.kestra.plugin.mongodb.Load
yaml
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

MongoDB collection

MongoDB connection properties

Definitions
uri*Requiredstring

Connection string to MongoDB server

URL format like mongodb://mongodb0.example.com: 27017

MongoDB database

Source file

Path in internal storage (kestra://...) containing BSON or JSON documents to stream into MongoDB.

Default1000

Bulk chunk size

Number of write models sent per bulkWrite call; defaults to 1000.

Field used as _id

If set, value is converted to ObjectId and stored as _id.

Reference (ref) of the pluginDefaults to apply to this task.

Defaulttrue

Remove idKey field

When true (default), drops the source field after copying it to _id.

Default0

Deleted documents

Documents removed by bulk delete models.

Default0

Inserted documents

Count of documents created by bulk writes.

Default0

Matched documents

Documents matched by update or replacement models.

Default0

Modified documents

Documents updated by bulk operations.

Rows processed

Total records read from the source file.

Unitcount

Number of documents processed in the bulk operation

Unitcount

Number of bulk requests sent to MongoDB