Send a bulk request to MongoDB.

Execute Bulk requests in MongoDB such as inserts and deletes. Below are sample file contents that can be provided as an input to the Bulk task:

text
{ "insertOne" : {"firstName": "John", "lastName": "Doe", "city": "Paris"}}
{ "insertOne" : {"firstName": "Ravi", "lastName": "Singh", "city": "Mumbai"}}
{ "deleteMany": {"filter": {"city": "Bengaluru"}}}
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.

MongoDB database.

The source file.

Default 1000

Chunk size for every bulk request.

Default 0

The number of documents deleted by the write operation.

Default 0

The number of documents inserted by the write operation.

Default 0

The number of documents matched by updates or replacements in the write operation.

Default 0

The number of documents modified by the write operation.

The number of rows processed.

Connection string to MongoDB server.

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