Insert documents into a DocumentDB collection.

Insert one or more documents into a DocumentDB collection. Can insert a single document or multiple documents (max 10) in one operation.

yaml
type: "io.kestra.plugin.documentdb.Insert"

Insert a single user document

yaml
id: insert_documentdb_user
namespace: company.documentdb

tasks:
  - id: insert_user
    type: io.kestra.plugin.documentdb.Insert
    host: "https://my-documentdb-instance.com"
    database: "myapp"
    collection: "users"
    username: "{{ secret('DOCUMENTDB_USERNAME') }}"
    password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
    document:
      name: "John Doe"
      email: "[email protected]"
      age: 30
      created_at: "{{ now() }}"

Insert multiple product documents

yaml
id: insert_products
namespace: company.documentdb

tasks:
  - id: insert_product_batch
    type: io.kestra.plugin.documentdb.Insert
    host: "https://my-documentdb-instance.com"
    database: "inventory"
    collection: "products"
    username: "{{ secret('DOCUMENTDB_USERNAME') }}"
    password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
    documents:
      - name: "Laptop"
        price: 999.99
        category: "Electronics"
        in_stock: true
      - name: "Mouse"
        price: 29.99
        category: "Electronics"
        in_stock: false

Insert document with dynamic data

yaml
id: insert_dynamic_order
namespace: company.documentdb

inputs:
  - id: customer_id
    type: STRING
    required: true
  - id: product_name
    type: STRING
    required: true
  - id: quantity
    type: INT
    required: true

tasks:
  - id: insert_order
    type: io.kestra.plugin.documentdb.Insert
    host: "https://my-documentdb-instance.com"
    database: "sales"
    collection: "orders"
    username: "{{ secret('DOCUMENTDB_USERNAME') }}"
    password: "{{ secret('DOCUMENTDB_PASSWORD') }}"
    document:
      customer_id: "{{ inputs.customer_id }}"
      product: "{{ inputs.product_name }}"
      quantity: "{{ inputs.quantity }}"
      order_date: "{{ now() }}"
      status: "pending"
Properties

Collection name

The name of the collection

Database name

The name of the database

DocumentDB host

The HTTP endpoint URL of your DocumentDB instance

Password

DocumentDB password for authentication

Username

DocumentDB username for authentication

Document for single insert

Document to insert (for single document insertion). Use this OR documents, not both.

SubType object

Multiple documents

List of documents to insert (max 10). Use this OR document, not both.

Number of documents inserted

Total count of documents successfully inserted

Inserted document ID

The ID of the first inserted document (for single insert or first of multiple)

SubType string

All inserted document IDs

List of all inserted document IDs