summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/bulk_write.idl
diff options
context:
space:
mode:
authorFrederic Vitzikam <frederic.vitzikam@mongodb.com>2023-02-22 17:17:50 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-22 19:33:54 +0000
commit8bea11983310ab5be581d59bd84573a2089c8825 (patch)
treefc3619ef799476763b0c394a2e08a9a1ae651d5d /src/mongo/db/commands/bulk_write.idl
parent6e51fc41373db8b38a2a83ffcef91449a211ee49 (diff)
downloadmongo-8bea11983310ab5be581d59bd84573a2089c8825.tar.gz
SERVER-72092 Add update/delete op type to bulkWrite command
Diffstat (limited to 'src/mongo/db/commands/bulk_write.idl')
-rw-r--r--src/mongo/db/commands/bulk_write.idl139
1 files changed, 135 insertions, 4 deletions
diff --git a/src/mongo/db/commands/bulk_write.idl b/src/mongo/db/commands/bulk_write.idl
index 767c7561444..0e77781f853 100644
--- a/src/mongo/db/commands/bulk_write.idl
+++ b/src/mongo/db/commands/bulk_write.idl
@@ -48,7 +48,7 @@ types:
command."
cpp_type: "mongo::BulkWriteReplyItem"
serializer: "mongo::BulkWriteReplyItem::serialize"
- deserializer: "mongo::BulkWriteReplyItem::parse"
+ deserializer: "mongo::BulkWriteReplyItem::parse"
structs:
@@ -63,7 +63,138 @@ structs:
stability: unstable
document:
description: "The document to insert into the given collection"
- type: object_owned
+ type: object
+ stability: unstable
+
+ BulkWriteUpdateOp:
+ description: "A struct representing updates in the 'bulkWrite' command."
+ strict: true
+ fields:
+ update:
+ description: "Update command which references the namespace index in 'nsInfo'."
+ type: safeInt
+ validator: { gte: 0 }
+ stability: unstable
+ filter:
+ description: "The query that matches documents to update. Uses the same query
+ selectors as used in the 'find' operation."
+ type: object
+ stability: unstable
+ multi:
+ description: "If true, updates all documents that meet the query criteria. If false,
+ limits the update to one document which meets the query criteria."
+ type: bool
+ default: false
+ stability: unstable
+ updateMods:
+ description: "Set of modifications to apply."
+ type: update_modification
+ stability: unstable
+ upsert:
+ description: "If true, perform an insert if no documents match the query. If both
+ upsert and multi are true and no documents match the query, the update
+ operation inserts only a single document."
+ type: bool
+ default: false
+ stability: unstable
+ upsertSupplied:
+ description: "Only applicable when upsert is true. If set, and if no documents match
+ the query, the update subsystem will insert the document supplied as
+ 'let.new' rather than generating a new document from the update spec."
+ type: optionalBool
+ stability: unstable
+ arrayFilters:
+ description: "Specifies which array elements an update modifier should apply to"
+ type: array<object>
+ optional: true
+ stability: unstable
+ hint:
+ description: "Specifies the hint to use for the operation."
+ type: indexHint
+ default: mongo::BSONObj()
+ stability: unstable
+ let:
+ description: "Specifies constant values that can be referred to in the pipeline
+ performing a custom update."
+ type: object
+ optional: true
+ stability: unstable
+ collation:
+ description: "Specifies the collation to use for the operation."
+ type: object
+ optional: true
+ stability: unstable
+ sort:
+ description: "Determines which document the operation modifies if the query selects
+ multiple documents."
+ type: object
+ optional: true
+ stability: unstable
+ return:
+ description: "When set to 'post', returns the modified document
+ rather than the original. Default is to return the original ('pre')."
+ type: string
+ optional: true
+ validator:
+ callback: validateUpdateReturn
+ stability: unstable
+ returnFields:
+ description: "A subset of fields to return."
+ type: object
+ optional: true
+ stability: unstable
+
+ BulkWriteDeleteOp:
+ description: "A struct representing deletes in the 'bulkWrite' command."
+ strict: true
+ fields:
+ delete:
+ description: "Delete command which references the namespace index in 'nsInfo'."
+ cpp_name: deleteCommand # `delete` is a C++ keyword.
+ type: safeInt
+ validator: { gte: 0 }
+ stability: unstable
+ filter:
+ description: "The query that matches documents to update. Uses the same query
+ selectors as used in the 'find' operation."
+ type: object
+ stability: unstable
+ multi:
+ description: "If true, updates all documents that meet the query criteria. If false,
+ limits the update to one document which meets the query criteria."
+ type: bool
+ default: false
+ stability: unstable
+ hint:
+ description: "Specifies the hint to use for the operation."
+ type: indexHint
+ default: mongo::BSONObj()
+ stability: unstable
+ let:
+ description: "Specifies constant values that can be referred to in the pipeline
+ performing a custom update."
+ type: object
+ optional: true
+ stability: unstable
+ collation:
+ description: "Specifies the collation to use for the operation."
+ type: object
+ optional: true
+ stability: unstable
+ sort:
+ description: "Determines which document the operation modifies if the query selects
+ multiple documents."
+ type: object
+ optional: true
+ stability: unstable
+ return:
+ description: "When true, returns the deleted document rather than nothing."
+ type: optionalBool
+ stability: unstable
+ returnFields:
+ description: "A subset of fields to return."
+ type: object
+ optional: true
stability: unstable
NamespaceInfoEntry:
@@ -89,7 +220,7 @@ structs:
mongos on the time-series view, but got rewritten to target
time-series buckets namespace before being sent to shards."
type: optionalBool
- stability: internal
+ stability: internal
BulkWriteCommandResponseCursor:
description: "Cursor holding results for a successful 'bulkWrite' command."
@@ -141,7 +272,7 @@ commands:
fields:
ops:
description: "An array of CRUD ops in the bulk write."
- type: array<BulkWriteInsertOp>
+ type: array<variant<BulkWriteInsertOp, BulkWriteUpdateOp, BulkWriteDeleteOp>>
supports_doc_sequence: true
stability: unstable
nsInfo: