Bulk Bulk

yaml
type: "io.kestra.plugin.mongodb.Bulk"

Execute Bulk request in MongoDB.

Here are the sample file contents that can be provided as input to Bulk task:

{ "insertOne" : {"firstName": "John", "lastName": "Doe", "city": "Paris"}}
{ "insertOne" : {"firstName": "Ravi", "lastName": "Singh", "city": "Mumbai"}}
{ "deleteMany": {"filter": {"city": "Bengaluru"}}}

Examples

yaml
id: mongodb_bulk
namespace: company.team

inputs:
  - id: myfile
    type: FILE

tasks:
  - id: bulk
    type: io.kestra.plugin.mongodb.Bulk
    connection:
      uri: "mongodb://root:example@localhost:27017/?authSource=admin"
    database: "my_database"
    collection: "my_collection"
    from: "{{ inputs.myfile }}"

Properties

collection

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

MongoDB collection.

connection

MongoDB connection properties.

database

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

MongoDB database.

from

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The source file.

chunk

  • Type: integer
  • Dynamic: ✔️
  • Required:
  • Default: 1000

Chunk size for every bulk request.

Outputs

deletedCount

  • Type: integer
  • Required:
  • Default: 0

The number of documents deleted by the write operation.

insertedCount

  • Type: integer
  • Required:
  • Default: 0

The number of documents inserted by the write operation.

matchedCount

  • Type: integer
  • Required:
  • Default: 0

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

modifiedCount

  • Type: integer
  • Required:
  • Default: 0

The number of documents modified by the write operation.

size

  • Type: integer
  • Required:

The number of rows processed.

Definitions

io.kestra.plugin.mongodb.MongoDbConnection

Properties

uri
  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

Connection string to MongoDB server.

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

Was this page helpful?