Update
Update or Replace one or many documents in a MongoDB collection.
yaml
type: "io.kestra.plugin.mongodb.Update"
Replace a document.
yaml
id: mongodb_update
namespace: company.team
tasks:
- id: update
type: io.kestra.plugin.mongodb.Update
connection:
uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
operation: "REPLACE_ONE"
document:
_id:
$oid: 60930c39a982931c20ef6cd6
name: "John Doe"
city: "Paris"
filter:
_id:
$oid: 60930c39a982931c20ef6cd6
Update a document.
yaml
id: mongodb_update
namespace: company.team
tasks:
- id: update
type: io.kestra.plugin.mongodb.Update
connection:
uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
filter:
_id:
$oid: 60930c39a982931c20ef6cd6
document: "{"$set": { "tags": ["blue", "green", "red"]}}"
Dynamic
YES
MongoDB collection.
Dynamic
NO
MongoDB connection properties.
Dynamic
YES
MongoDB database.
Dynamic
YES
MongoDB document.
Can be a BSON string, or a map.
Dynamic
YES
MongoDB BSON filter.
Can be a BSON string, or a map.
Dynamic
YES
Default
UPDATE_ONE
Possible Values
REPLACE_ONE
UPDATE_ONE
UPDATE_MANY
Operation to use.
Default
0
The number of documents matched by the query.
The number of documents modified by the update.
The upserted ID.
Will be null for replace
operation.
Whether the write was acknowledged.
Dynamic
YES
Connection string to MongoDB server.
URL format like mongodb://mongodb0.example.com: 27017