MongoDB Bulk

MongoDB Bulk

Certified

Run MongoDB bulkWrite from NDJSON

Reads newline-delimited bulk operations from internal storage and executes MongoDB bulkWrite. Supports insert/update/delete formats defined in MongoDB Bulk API (https://www.mongodb.com/docs/manual/reference/method/Bulk/). Inherits chunking from AbstractLoad (default 1000 per bulk request).

yaml
type: io.kestra.plugin.mongodb.Bulk
yaml
id: mongodb_bulk
namespace: company.team

tasks:
  - id: make_actions
    type: io.kestra.plugin.core.storage.Write
    content: |
      { "insertOne" : {"firstName": "John", "lastName": "Doe", "city": "Paris"}}
      { "insertOne" : {"firstName": "Ravi", "lastName": "Singh", "city": "Mumbai"}}
      { "deleteMany": {"filter": {"city": "Bengaluru"}}}

  - id: bulk
    type: io.kestra.plugin.mongodb.Bulk
    connection:
      uri: "mongodb://YOUR_HOST:27017"
    database: "my_database"
    collection: "my_collection"
    from: "{{ outputs.make_actions.uri }}"
Properties

MongoDB collection

MongoDB connection properties

Definitions
uri*string

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.

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.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset 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.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Default1000

Bulk chunk size

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

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