
MongoDB Bulk
CertifiedRun MongoDB bulkWrite from NDJSON
MongoDB Bulk
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).
type: io.kestra.plugin.mongodb.BulkExamples
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
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.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
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