Delete Delete

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

Delete one or many documents from a MongoDB collection.

Examples

yaml
id: mongodb_delete
namespace: company.team

tasks:
  - id: delete
    type: io.kestra.plugin.mongodb.Delete
    connection:
      uri: "mongodb://root:example@localhost:27017/?authSource=admin"
    database: "my_database"
    collection: "my_collection"
    operation: "DELETE_ONE"
    filter:
      _id:
        $oid: 60930c39a982931c20ef6cd6

Properties

collection

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

MongoDB collection.

connection

MongoDB connection properties.

database

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

MongoDB database.

operation

  • Type: string
  • Dynamic:
  • Required: ✔️
  • Default: DELETE_ONE
  • Possible Values:
    • DELETE_ONE
    • DELETE_MANY

Operation to use.

filter

  • Type: object
  • Dynamic: ✔️
  • Required:

MongoDB BSON filter.

Can be a BSON string, or a map.

Outputs

deletedCount

  • Type: integer
  • Required:
  • Default: 0

The number of documents deleted.

wasAcknowledged

  • Type: boolean
  • Required:

Whether the write was acknowledged.

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?