summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops/batched_command_request.cpp
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/s/write_ops/batched_command_request.cpp
parent6e51fc41373db8b38a2a83ffcef91449a211ee49 (diff)
downloadmongo-8bea11983310ab5be581d59bd84573a2089c8825.tar.gz
SERVER-72092 Add update/delete op type to bulkWrite command
Diffstat (limited to 'src/mongo/s/write_ops/batched_command_request.cpp')
-rw-r--r--src/mongo/s/write_ops/batched_command_request.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/write_ops/batched_command_request.cpp b/src/mongo/s/write_ops/batched_command_request.cpp
index b0075f39765..20d634017f6 100644
--- a/src/mongo/s/write_ops/batched_command_request.cpp
+++ b/src/mongo/s/write_ops/batched_command_request.cpp
@@ -71,6 +71,14 @@ BatchedCommandRequest constructBatchedCommandRequest(const OpMsgRequest& request
} // namespace
+// TODO(SERVER-74155): consider this for the helper class to access variant op.
+const mongo::BulkWriteInsertOp& getInsert(const stdx::variant<mongo::BulkWriteInsertOp,
+ mongo::BulkWriteUpdateOp,
+ mongo::BulkWriteDeleteOp>& op) {
+ // Caller needs to check the type with getOpType or this stdx::get<>() will throw.
+ return stdx::get<mongo::BulkWriteInsertOp>(op);
+}
+
const boost::optional<LegacyRuntimeConstants> BatchedCommandRequest::kEmptyRuntimeConstants =
boost::optional<LegacyRuntimeConstants>{};
const boost::optional<BSONObj> BatchedCommandRequest::kEmptyLet = boost::optional<BSONObj>{};