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

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

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