summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-05-17 16:13:57 -0400
committerMathias Stearn <mathias@10gen.com>2017-05-17 19:29:36 -0400
commit9687c56dad047fb222076c0eb5fb25db6a796219 (patch)
treec3d197a64776090c57cd761d104f014ba8d2a8e8 /src/mongo/db
parent4ec8e7a515ceb3e87b64ddde624404d1c4498066 (diff)
downloadmongo-9687c56dad047fb222076c0eb5fb25db6a796219.tar.gz
SERVER-29260 Make BSONObj argument to Command::run() const&
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/auth/sasl_commands.cpp8
-rw-r--r--src/mongo/db/commands.h2
-rw-r--r--src/mongo/db/commands/apply_ops_cmd.cpp2
-rw-r--r--src/mongo/db/commands/authentication_commands.cpp6
-rw-r--r--src/mongo/db/commands/authentication_commands.h2
-rw-r--r--src/mongo/db/commands/clone.cpp2
-rw-r--r--src/mongo/db/commands/clone_collection.cpp2
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp4
-rw-r--r--src/mongo/db/commands/compact.cpp2
-rw-r--r--src/mongo/db/commands/conn_pool_stats.cpp2
-rw-r--r--src/mongo/db/commands/conn_pool_sync.cpp2
-rw-r--r--src/mongo/db/commands/connection_status.cpp2
-rw-r--r--src/mongo/db/commands/copydb.cpp2
-rw-r--r--src/mongo/db/commands/copydb_start_commands.cpp4
-rw-r--r--src/mongo/db/commands/count_cmd.cpp2
-rw-r--r--src/mongo/db/commands/cpuload.cpp2
-rw-r--r--src/mongo/db/commands/cpuprofile.cpp8
-rw-r--r--src/mongo/db/commands/create_indexes.cpp2
-rw-r--r--src/mongo/db/commands/current_op.cpp2
-rw-r--r--src/mongo/db/commands/dbcommands.cpp28
-rw-r--r--src/mongo/db/commands/dbhash.cpp2
-rw-r--r--src/mongo/db/commands/distinct.cpp2
-rw-r--r--src/mongo/db/commands/driverHelpers.cpp2
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp4
-rw-r--r--src/mongo/db/commands/eval.cpp2
-rw-r--r--src/mongo/db/commands/explain_cmd.cpp2
-rw-r--r--src/mongo/db/commands/fail_point_cmd.cpp2
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp2
-rw-r--r--src/mongo/db/commands/find_cmd.cpp2
-rw-r--r--src/mongo/db/commands/fsync.cpp4
-rw-r--r--src/mongo/db/commands/generic.cpp20
-rw-r--r--src/mongo/db/commands/geo_near_cmd.cpp2
-rw-r--r--src/mongo/db/commands/get_last_error.cpp6
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp4
-rw-r--r--src/mongo/db/commands/group_cmd.cpp2
-rw-r--r--src/mongo/db/commands/hashcmd.cpp2
-rw-r--r--src/mongo/db/commands/haystack.cpp2
-rw-r--r--src/mongo/db/commands/index_filter_commands.cpp8
-rw-r--r--src/mongo/db/commands/index_filter_commands.h10
-rw-r--r--src/mongo/db/commands/isself.cpp2
-rw-r--r--src/mongo/db/commands/kill_op.cpp2
-rw-r--r--src/mongo/db/commands/killcursors_common.cpp2
-rw-r--r--src/mongo/db/commands/killcursors_common.h2
-rw-r--r--src/mongo/db/commands/list_collections.cpp2
-rw-r--r--src/mongo/db/commands/list_databases.cpp2
-rw-r--r--src/mongo/db/commands/list_indexes.cpp2
-rw-r--r--src/mongo/db/commands/lock_info.cpp2
-rw-r--r--src/mongo/db/commands/mr.cpp4
-rw-r--r--src/mongo/db/commands/oplog_note.cpp2
-rw-r--r--src/mongo/db/commands/parallel_collection_scan.cpp2
-rw-r--r--src/mongo/db/commands/parameters.cpp4
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp2
-rw-r--r--src/mongo/db/commands/plan_cache_commands.cpp8
-rw-r--r--src/mongo/db/commands/plan_cache_commands.h10
-rw-r--r--src/mongo/db/commands/rename_collection_cmd.cpp2
-rw-r--r--src/mongo/db/commands/repair_cursor.cpp2
-rw-r--r--src/mongo/db/commands/server_status.cpp2
-rw-r--r--src/mongo/db/commands/set_feature_compatibility_version_command.cpp2
-rw-r--r--src/mongo/db/commands/snapshot_management.cpp4
-rw-r--r--src/mongo/db/commands/test_commands.cpp8
-rw-r--r--src/mongo/db/commands/top_command.cpp2
-rw-r--r--src/mongo/db/commands/touch.cpp2
-rw-r--r--src/mongo/db/commands/user_management_commands.cpp40
-rw-r--r--src/mongo/db/commands/validate.cpp2
-rw-r--r--src/mongo/db/commands/write_commands/write_commands.cpp2
-rw-r--r--src/mongo/db/exec/stagedebug_cmd.cpp2
-rw-r--r--src/mongo/db/ftdc/ftdc_commands.cpp2
-rw-r--r--src/mongo/db/repl/master_slave.cpp2
-rw-r--r--src/mongo/db/repl/repl_set_commands.cpp32
-rw-r--r--src/mongo/db/repl/repl_set_request_votes.cpp2
-rw-r--r--src/mongo/db/repl/replication_info.cpp2
-rw-r--r--src/mongo/db/repl/resync.cpp2
-rw-r--r--src/mongo/db/s/check_sharding_index_command.cpp2
-rw-r--r--src/mongo/db/s/cleanup_orphaned_cmd.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_add_shard_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_control_balancer_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_merge_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_move_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_split_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp2
-rw-r--r--src/mongo/db/s/get_shard_version_command.cpp2
-rw-r--r--src/mongo/db/s/merge_chunks_command.cpp2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp4
-rw-r--r--src/mongo/db/s/migration_destination_manager_legacy_commands.cpp8
-rw-r--r--src/mongo/db/s/move_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/set_shard_version_command.cpp2
-rw-r--r--src/mongo/db/s/sharding_state_command.cpp2
-rw-r--r--src/mongo/db/s/split_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/split_vector_command.cpp2
-rw-r--r--src/mongo/db/s/unset_sharding_command.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp2
95 files changed, 190 insertions, 190 deletions
diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp
index d311f174b6b..e0fad877a25 100644
--- a/src/mongo/db/auth/sasl_commands.cpp
+++ b/src/mongo/db/auth/sasl_commands.cpp
@@ -75,7 +75,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& ignored,
BSONObjBuilder& result);
@@ -102,7 +102,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& ignored,
BSONObjBuilder& result);
@@ -270,7 +270,7 @@ void CmdSaslStart::redactForLogging(mutablebson::Document* cmdObj) {
bool CmdSaslStart::run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& ignored,
BSONObjBuilder& result) {
Client* client = Client::getCurrent();
@@ -311,7 +311,7 @@ void CmdSaslContinue::help(std::stringstream& os) const {
bool CmdSaslContinue::run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& ignored,
BSONObjBuilder& result) {
Client* client = Client::getCurrent();
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index d0f4d2bba25..a9bfc682712 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -124,7 +124,7 @@ public:
*/
virtual bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) = 0;
diff --git a/src/mongo/db/commands/apply_ops_cmd.cpp b/src/mongo/db/commands/apply_ops_cmd.cpp
index be1184edc62..9b142037601 100644
--- a/src/mongo/db/commands/apply_ops_cmd.cpp
+++ b/src/mongo/db/commands/apply_ops_cmd.cpp
@@ -87,7 +87,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
validateApplyOpsCommand(cmdObj);
diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp
index 438da755c30..58493790818 100644
--- a/src/mongo/db/commands/authentication_commands.cpp
+++ b/src/mongo/db/commands/authentication_commands.cpp
@@ -115,7 +115,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
nonce64 n = getNextNonce();
@@ -152,7 +152,7 @@ void CmdAuthenticate::redactForLogging(mutablebson::Document* cmdObj) {
bool CmdAuthenticate::run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (!serverGlobalParams.quiet.load()) {
@@ -375,7 +375,7 @@ public:
CmdLogout() : Command("logout") {}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
AuthorizationSession* authSession = AuthorizationSession::get(Client::getCurrent());
diff --git a/src/mongo/db/commands/authentication_commands.h b/src/mongo/db/commands/authentication_commands.h
index e49c214091c..f6b0c66e147 100644
--- a/src/mongo/db/commands/authentication_commands.h
+++ b/src/mongo/db/commands/authentication_commands.h
@@ -57,7 +57,7 @@ public:
CmdAuthenticate() : Command("authenticate") {}
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp
index 68674aead43..14585aedcd4 100644
--- a/src/mongo/db/commands/clone.cpp
+++ b/src/mongo/db/commands/clone.cpp
@@ -89,7 +89,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
boost::optional<DisableDocumentValidation> maybeDisableValidation;
diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp
index f8aeb131026..c1ca464ea4c 100644
--- a/src/mongo/db/commands/clone_collection.cpp
+++ b/src/mongo/db/commands/clone_collection.cpp
@@ -105,7 +105,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
boost::optional<DisableDocumentValidation> maybeDisableValidation;
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index 62fab6dfe69..b749b2b1b23 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -86,7 +86,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const auto fromElt = jsobj["cloneCollectionAsCapped"];
@@ -170,7 +170,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj));
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp
index bd408337cc5..e7c914ef0c4 100644
--- a/src/mongo/db/commands/compact.cpp
+++ b/src/mongo/db/commands/compact.cpp
@@ -88,7 +88,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
NamespaceString nss = parseNsCollectionRequired(db, cmdObj);
diff --git a/src/mongo/db/commands/conn_pool_stats.cpp b/src/mongo/db/commands/conn_pool_stats.cpp
index c3700b839bf..88a74cdbd30 100644
--- a/src/mongo/db/commands/conn_pool_stats.cpp
+++ b/src/mongo/db/commands/conn_pool_stats.cpp
@@ -71,7 +71,7 @@ public:
bool run(OperationContext* opCtx,
const std::string&,
- mongo::BSONObj&,
+ const mongo::BSONObj&,
std::string&,
mongo::BSONObjBuilder& result) override {
executor::ConnectionPoolStats stats{};
diff --git a/src/mongo/db/commands/conn_pool_sync.cpp b/src/mongo/db/commands/conn_pool_sync.cpp
index 602f6e8421d..32bdda9bffa 100644
--- a/src/mongo/db/commands/conn_pool_sync.cpp
+++ b/src/mongo/db/commands/conn_pool_sync.cpp
@@ -56,7 +56,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string&,
- mongo::BSONObj&,
+ const mongo::BSONObj&,
std::string&,
mongo::BSONObjBuilder& result) {
shardConnectionPool.flush();
diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp
index c21d1427414..10cd52c4815 100644
--- a/src/mongo/db/commands/connection_status.cpp
+++ b/src/mongo/db/commands/connection_status.cpp
@@ -57,7 +57,7 @@ public:
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
AuthorizationSession* authSession = AuthorizationSession::get(Client::getCurrent());
diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp
index 88ef6540e02..e0ab332ac04 100644
--- a/src/mongo/db/commands/copydb.cpp
+++ b/src/mongo/db/commands/copydb.cpp
@@ -117,7 +117,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
boost::optional<DisableDocumentValidation> maybeDisableValidation;
diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp
index e028431cf71..24ebc9c695a 100644
--- a/src/mongo/db/commands/copydb_start_commands.cpp
+++ b/src/mongo/db/commands/copydb_start_commands.cpp
@@ -98,7 +98,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
string fromhost = cmdObj.getStringField("fromhost");
@@ -171,7 +171,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const auto fromdbElt = cmdObj["fromdb"];
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp
index 2af91e01876..0003b2bf806 100644
--- a/src/mongo/db/commands/count_cmd.cpp
+++ b/src/mongo/db/commands/count_cmd.cpp
@@ -166,7 +166,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool isExplain = false;
diff --git a/src/mongo/db/commands/cpuload.cpp b/src/mongo/db/commands/cpuload.cpp
index 3ad635a57d7..f8ac54313e6 100644
--- a/src/mongo/db/commands/cpuload.cpp
+++ b/src/mongo/db/commands/cpuload.cpp
@@ -60,7 +60,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* txn,
const string& badns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
double cpuFactor = 1;
diff --git a/src/mongo/db/commands/cpuprofile.cpp b/src/mongo/db/commands/cpuprofile.cpp
index 8f9c16901fe..c5ec73204a9 100644
--- a/src/mongo/db/commands/cpuprofile.cpp
+++ b/src/mongo/db/commands/cpuprofile.cpp
@@ -105,7 +105,7 @@ public:
virtual bool run(OperationContext* opCtx,
std::string const& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
@@ -121,7 +121,7 @@ public:
virtual bool run(OperationContext* opCtx,
std::string const& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
@@ -133,7 +133,7 @@ char const* const CpuProfilerStopCommand::commandName = "_cpuProfilerStop";
bool CpuProfilerStartCommand::run(OperationContext* opCtx,
std::string const& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
// The DB lock here is just so we have IX on the global lock in order to prevent shutdown
@@ -150,7 +150,7 @@ bool CpuProfilerStartCommand::run(OperationContext* opCtx,
bool CpuProfilerStopCommand::run(OperationContext* opCtx,
std::string const& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
// The DB lock here is just so we have IX on the global lock in order to prevent shutdown
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp
index db71d3bebf5..77feecc13a0 100644
--- a/src/mongo/db/commands/create_indexes.cpp
+++ b/src/mongo/db/commands/create_indexes.cpp
@@ -227,7 +227,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj));
diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp
index 3a86aaabf31..623610d3e66 100644
--- a/src/mongo/db/commands/current_op.cpp
+++ b/src/mongo/db/commands/current_op.cpp
@@ -87,7 +87,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
const bool includeAll = cmdObj["$all"].trueValue();
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index f41d6a2ae2b..e1383becee1 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -126,7 +126,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
bool force = cmdObj.hasField("force") && cmdObj["force"].trueValue();
@@ -175,7 +175,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
// disallow dropping the config database
@@ -243,7 +243,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BSONElement e = cmdObj.firstElement();
@@ -346,7 +346,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BSONElement firstElement = cmdObj.firstElement();
@@ -428,7 +428,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const char* deprecationWarning =
@@ -485,7 +485,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nsToDrop = parseNsCollectionRequired(dbname, cmdObj);
@@ -536,7 +536,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj));
@@ -677,7 +677,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNs(dbname, jsobj));
@@ -856,7 +856,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
Timer timer;
@@ -999,7 +999,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj));
@@ -1047,7 +1047,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj));
@@ -1082,7 +1082,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
int scale = 1;
@@ -1166,7 +1166,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
result << "you" << opCtx->getClient()->clientAddress(true /*includePort*/);
@@ -1192,7 +1192,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
result << "options" << QueryOption_AllSupported;
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp
index 598fe1aad7c..5aaf0d382ca 100644
--- a/src/mongo/db/commands/dbhash.cpp
+++ b/src/mongo/db/commands/dbhash.cpp
@@ -80,7 +80,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Timer timer;
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp
index 6c2bef4012a..c1958e34f55 100644
--- a/src/mongo/db/commands/distinct.cpp
+++ b/src/mongo/db/commands/distinct.cpp
@@ -166,7 +166,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
diff --git a/src/mongo/db/commands/driverHelpers.cpp b/src/mongo/db/commands/driverHelpers.cpp
index 994eb54605c..ae169abd8b6 100644
--- a/src/mongo/db/commands/driverHelpers.cpp
+++ b/src/mongo/db/commands/driverHelpers.cpp
@@ -75,7 +75,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (cmdObj.firstElement().type() != jstOID) {
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp
index 0a78963ad1f..b8c6e5442cb 100644
--- a/src/mongo/db/commands/drop_indexes.cpp
+++ b/src/mongo/db/commands/drop_indexes.cpp
@@ -86,7 +86,7 @@ public:
CmdDropIndexes() : Command("dropIndexes", "deleteIndexes") {}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss = parseNsCollectionRequired(dbname, jsobj);
@@ -117,7 +117,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
DBDirectClient db(opCtx);
diff --git a/src/mongo/db/commands/eval.cpp b/src/mongo/db/commands/eval.cpp
index 3a11e45e11f..dbebb016e16 100644
--- a/src/mongo/db/commands/eval.cpp
+++ b/src/mongo/db/commands/eval.cpp
@@ -176,7 +176,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
// Note: 'eval' is not allowed to touch sharded namespaces, but we can't check the
diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp
index b62fe416ac7..e55da5b2974 100644
--- a/src/mongo/db/commands/explain_cmd.cpp
+++ b/src/mongo/db/commands/explain_cmd.cpp
@@ -122,7 +122,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto verbosity = ExplainOptions::parseCmdBSON(cmdObj);
diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp
index ce8f1367f58..17d447550e5 100644
--- a/src/mongo/db/commands/fail_point_cmd.cpp
+++ b/src/mongo/db/commands/fail_point_cmd.cpp
@@ -92,7 +92,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const string failPointName(cmdObj.firstElement().str());
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index 5ec268571e5..01d5d70b584 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -337,7 +337,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
// findAndModify command is not replicated directly.
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp
index dc6640989f9..8c7759471ce 100644
--- a/src/mongo/db/commands/find_cmd.cpp
+++ b/src/mongo/db/commands/find_cmd.cpp
@@ -228,7 +228,7 @@ public:
*/
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNsOrUUID(opCtx, dbname, cmdObj));
diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp
index 1a9b7628503..5359963d381 100644
--- a/src/mongo/db/commands/fsync.cpp
+++ b/src/mongo/db/commands/fsync.cpp
@@ -119,7 +119,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (opCtx->lockState()->isLocked()) {
@@ -292,7 +292,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
log() << "command: unlock requested";
diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp
index 0a54dc74bbb..d520f59e2c6 100644
--- a/src/mongo/db/commands/generic.cpp
+++ b/src/mongo/db/commands/generic.cpp
@@ -91,7 +91,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
std::string& errmsg,
BSONObjBuilder& result) {
VersionInfoInterface::instance().appendBuildInfo(&result);
@@ -120,7 +120,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* opCtx,
const string& badns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
// IMPORTANT: Don't put anything in here that might lock db - including authentication
@@ -145,7 +145,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (getGlobalScriptEngine()) {
@@ -187,7 +187,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
ProcessInfo p;
@@ -234,7 +234,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
bool didRotate = rotateLogs(serverGlobalParams.logRenameOnRotate);
@@ -265,7 +265,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
virtual bool run(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
// sort the commands before building the result BSON
@@ -363,7 +363,7 @@ public:
CmdForceError() : Command("forceerror") {}
bool run(OperationContext* opCtx,
const string& dbnamne,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
LastError::get(cc()).setLastError(10038, "forced error");
@@ -397,7 +397,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BSONElement val = cmdObj.firstElement();
@@ -468,7 +468,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
std::string logName;
@@ -520,7 +520,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
result.append("argv", serverGlobalParams.argvArray);
diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp
index 65cf9a857dc..ce4f54a5790 100644
--- a/src/mongo/db/commands/geo_near_cmd.cpp
+++ b/src/mongo/db/commands/geo_near_cmd.cpp
@@ -100,7 +100,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (!cmdObj["start"].eoo()) {
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index e153de58188..7196c363ec3 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -72,7 +72,7 @@ public:
CmdResetError() : Command("resetError", "reseterror") {}
bool run(OperationContext* opCtx,
const string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
LastError::get(opCtx->getClient()).reset();
@@ -105,7 +105,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
//
@@ -313,7 +313,7 @@ public:
CmdGetPrevError() : Command("getPrevError", "getpreverror") {}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
LastError* le = &LastError::get(opCtx->getClient());
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index de15131f3fd..59c2848313c 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -148,7 +148,7 @@ public:
bool runParsed(OperationContext* opCtx,
const NamespaceString& origNss,
const GetMoreRequest& request,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
@@ -443,7 +443,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
// Counted as a getMore, not as a command.
diff --git a/src/mongo/db/commands/group_cmd.cpp b/src/mongo/db/commands/group_cmd.cpp
index ac17916ef31..45cd9c999ce 100644
--- a/src/mongo/db/commands/group_cmd.cpp
+++ b/src/mongo/db/commands/group_cmd.cpp
@@ -150,7 +150,7 @@ private:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
RARELY {
diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp
index b47b2352650..a540cd771f0 100644
--- a/src/mongo/db/commands/hashcmd.cpp
+++ b/src/mongo/db/commands/hashcmd.cpp
@@ -81,7 +81,7 @@ public:
**/
bool run(OperationContext* opCtx,
const string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
result.appendAs(cmdObj.firstElement(), "key");
diff --git a/src/mongo/db/commands/haystack.cpp b/src/mongo/db/commands/haystack.cpp
index 77270437ff7..b2b7f9977b6 100644
--- a/src/mongo/db/commands/haystack.cpp
+++ b/src/mongo/db/commands/haystack.cpp
@@ -97,7 +97,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj);
diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp
index 101294e4dde..42e9419622c 100644
--- a/src/mongo/db/commands/index_filter_commands.cpp
+++ b/src/mongo/db/commands/index_filter_commands.cpp
@@ -117,7 +117,7 @@ IndexFilterCommand::IndexFilterCommand(const string& name, const string& helpTex
bool IndexFilterCommand::run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
@@ -161,7 +161,7 @@ ListFilters::ListFilters()
Status ListFilters::runIndexFilterCommand(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
// This is a read lock. The query settings is owned by the collection.
AutoGetCollectionForReadCommand ctx(opCtx, NamespaceString(ns));
@@ -229,7 +229,7 @@ ClearFilters::ClearFilters()
Status ClearFilters::runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
// This is a read lock. The query settings is owned by the collection.
AutoGetCollectionForReadCommand ctx(opCtx, NamespaceString(ns));
@@ -330,7 +330,7 @@ SetFilter::SetFilter()
Status SetFilter::runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
// This is a read lock. The query settings is owned by the collection.
const NamespaceString nss(ns);
diff --git a/src/mongo/db/commands/index_filter_commands.h b/src/mongo/db/commands/index_filter_commands.h
index 9cedd30f765..27c81dbc6ba 100644
--- a/src/mongo/db/commands/index_filter_commands.h
+++ b/src/mongo/db/commands/index_filter_commands.h
@@ -65,7 +65,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
@@ -93,7 +93,7 @@ public:
*/
virtual Status runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) = 0;
private:
@@ -112,7 +112,7 @@ public:
virtual Status runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
@@ -134,7 +134,7 @@ public:
virtual Status runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
@@ -168,7 +168,7 @@ public:
virtual Status runIndexFilterCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp
index bb1a023c7b5..014fb89ee2d 100644
--- a/src/mongo/db/commands/isself.cpp
+++ b/src/mongo/db/commands/isself.cpp
@@ -56,7 +56,7 @@ public:
std::vector<Privilege>* out) {} // No auth required
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
result.append("id", repl::instanceId);
diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp
index 6a6d4603443..6edd8b8b4a8 100644
--- a/src/mongo/db/commands/kill_op.cpp
+++ b/src/mongo/db/commands/kill_op.cpp
@@ -130,7 +130,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
long long opId = parseOpId(cmdObj);
diff --git a/src/mongo/db/commands/killcursors_common.cpp b/src/mongo/db/commands/killcursors_common.cpp
index b20aeb3f734..eaa9ec51baf 100644
--- a/src/mongo/db/commands/killcursors_common.cpp
+++ b/src/mongo/db/commands/killcursors_common.cpp
@@ -65,7 +65,7 @@ Status KillCursorsCmdBase::checkAuthForCommand(Client* client,
bool KillCursorsCmdBase::run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto statusWithRequest = KillCursorsRequest::parseFromBSON(dbname, cmdObj);
diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h
index 8d4bcf07c75..0944abd0468 100644
--- a/src/mongo/db/commands/killcursors_common.h
+++ b/src/mongo/db/commands/killcursors_common.h
@@ -72,7 +72,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final;
diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp
index e9038a46cfd..b667dfcb092 100644
--- a/src/mongo/db/commands/list_collections.cpp
+++ b/src/mongo/db/commands/list_collections.cpp
@@ -220,7 +220,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
unique_ptr<MatchExpression> matcher;
diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp
index d71d9ab3abb..4b96d386577 100644
--- a/src/mongo/db/commands/list_databases.cpp
+++ b/src/mongo/db/commands/list_databases.cpp
@@ -85,7 +85,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
// Parse the filter.
diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp
index 6d58c8c2b47..0e639d07108 100644
--- a/src/mongo/db/commands/list_indexes.cpp
+++ b/src/mongo/db/commands/list_indexes.cpp
@@ -118,7 +118,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString ns(parseNsOrUUID(opCtx, dbname, cmdObj));
diff --git a/src/mongo/db/commands/lock_info.cpp b/src/mongo/db/commands/lock_info.cpp
index 9318f734c9f..5a3c2dd5dab 100644
--- a/src/mongo/db/commands/lock_info.cpp
+++ b/src/mongo/db/commands/lock_info.cpp
@@ -81,7 +81,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) {
std::map<LockerId, BSONObj> lockToClientMap;
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index e4463ad7c1a..3cfb1ec4341 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -1375,7 +1375,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmd,
+ const BSONObj& cmd,
string& errmsg,
BSONObjBuilder& result) {
Timer t;
@@ -1710,7 +1710,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp
index 9a5760d616a..371057a68fa 100644
--- a/src/mongo/db/commands/oplog_note.cpp
+++ b/src/mongo/db/commands/oplog_note.cpp
@@ -115,7 +115,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp
index 41471f656aa..a81c9e3a4c5 100644
--- a/src/mongo/db/commands/parallel_collection_scan.cpp
+++ b/src/mongo/db/commands/parallel_collection_scan.cpp
@@ -87,7 +87,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj));
diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp
index 785375c514f..ab794c8bf0e 100644
--- a/src/mongo/db/commands/parameters.cpp
+++ b/src/mongo/db/commands/parameters.cpp
@@ -90,7 +90,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
bool all = *cmdObj.firstElement().valuestrsafe() == '*';
@@ -138,7 +138,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
int numSet = 0;
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index 9f21d3825db..79a2e76270d 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -83,7 +83,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
return appendCommandStatus(result,
diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp
index f194d17129e..c7ebdb034a1 100644
--- a/src/mongo/db/commands/plan_cache_commands.cpp
+++ b/src/mongo/db/commands/plan_cache_commands.cpp
@@ -112,7 +112,7 @@ PlanCacheCommand::PlanCacheCommand(const string& name,
bool PlanCacheCommand::run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
@@ -223,7 +223,7 @@ PlanCacheListQueryShapes::PlanCacheListQueryShapes()
Status PlanCacheListQueryShapes::runPlanCacheCommand(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
// This is a read lock. The query cache is owned by the collection.
AutoGetCollectionForReadCommand ctx(opCtx, NamespaceString(ns));
@@ -275,7 +275,7 @@ PlanCacheClear::PlanCacheClear()
Status PlanCacheClear::runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
// This is a read lock. The query cache is owned by the collection.
AutoGetCollectionForReadCommand ctx(opCtx, NamespaceString(ns));
@@ -352,7 +352,7 @@ PlanCacheListPlans::PlanCacheListPlans()
Status PlanCacheListPlans::runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) {
AutoGetCollectionForReadCommand ctx(opCtx, NamespaceString(ns));
diff --git a/src/mongo/db/commands/plan_cache_commands.h b/src/mongo/db/commands/plan_cache_commands.h
index 7b3da100782..8057aaaf95d 100644
--- a/src/mongo/db/commands/plan_cache_commands.h
+++ b/src/mongo/db/commands/plan_cache_commands.h
@@ -59,7 +59,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
@@ -87,7 +87,7 @@ public:
*/
virtual Status runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob) = 0;
/**
@@ -113,7 +113,7 @@ public:
PlanCacheListQueryShapes();
virtual Status runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
@@ -139,7 +139,7 @@ public:
PlanCacheClear();
virtual Status runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
@@ -168,7 +168,7 @@ public:
PlanCacheListPlans();
virtual Status runPlanCacheCommand(OperationContext* opCtx,
const std::string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
BSONObjBuilder* bob);
/**
diff --git a/src/mongo/db/commands/rename_collection_cmd.cpp b/src/mongo/db/commands/rename_collection_cmd.cpp
index 8a2afb4da64..9c4c027328c 100644
--- a/src/mongo/db/commands/rename_collection_cmd.cpp
+++ b/src/mongo/db/commands/rename_collection_cmd.cpp
@@ -87,7 +87,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const auto sourceNsElt = cmdObj[getName()];
diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp
index 031370f4316..5d644f78341 100644
--- a/src/mongo/db/commands/repair_cursor.cpp
+++ b/src/mongo/db/commands/repair_cursor.cpp
@@ -69,7 +69,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
NamespaceString ns(parseNs(dbname, cmdObj));
diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp
index 212498d178b..9edf5c43d16 100644
--- a/src/mongo/db/commands/server_status.cpp
+++ b/src/mongo/db/commands/server_status.cpp
@@ -87,7 +87,7 @@ public:
}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
_runCalled = true;
diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
index 10234b925ba..7f01ef9ca5a 100644
--- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
+++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
@@ -83,7 +83,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const auto version = uassertStatusOK(
diff --git a/src/mongo/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp
index 05782177b9e..20b406b34fc 100644
--- a/src/mongo/db/commands/snapshot_management.cpp
+++ b/src/mongo/db/commands/snapshot_management.cpp
@@ -66,7 +66,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto snapshotManager =
@@ -115,7 +115,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto snapshotManager =
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp
index 10016c71f0f..17cba2ee54a 100644
--- a/src/mongo/db/commands/test_commands.cpp
+++ b/src/mongo/db/commands/test_commands.cpp
@@ -77,7 +77,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
@@ -151,7 +151,7 @@ public:
CmdSleep() : Command("sleep") {}
bool run(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
log() << "test only command sleep invoked";
@@ -214,7 +214,7 @@ public:
std::vector<Privilege>* out) {}
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString fullNs = parseNsCollectionRequired(dbname, cmdObj);
@@ -291,7 +291,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj);
diff --git a/src/mongo/db/commands/top_command.cpp b/src/mongo/db/commands/top_command.cpp
index 8f306df9838..2b9c2e54671 100644
--- a/src/mongo/db/commands/top_command.cpp
+++ b/src/mongo/db/commands/top_command.cpp
@@ -67,7 +67,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
{
diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp
index 18c99460650..dbb6a2221af 100644
--- a/src/mongo/db/commands/touch.cpp
+++ b/src/mongo/db/commands/touch.cpp
@@ -84,7 +84,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj);
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp
index 8f147bc3baa..3126a71551d 100644
--- a/src/mongo/db/commands/user_management_commands.cpp
+++ b/src/mongo/db/commands/user_management_commands.cpp
@@ -618,7 +618,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::CreateOrUpdateUserArgs args;
@@ -764,7 +764,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::CreateOrUpdateUserArgs args;
@@ -881,7 +881,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
UserName userName;
@@ -949,7 +949,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = auth::parseAndValidateDropAllUsersFromDatabaseCommand(cmdObj, dbname);
@@ -1006,7 +1006,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
std::string userNameString;
@@ -1080,7 +1080,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
std::string userNameString;
@@ -1158,7 +1158,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::UsersInfoArgs args;
@@ -1270,7 +1270,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::CreateOrUpdateRoleArgs args;
@@ -1383,7 +1383,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::CreateOrUpdateRoleArgs args;
@@ -1481,7 +1481,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
@@ -1589,7 +1589,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
RoleName roleName;
@@ -1699,7 +1699,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
std::string roleNameString;
@@ -1790,7 +1790,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
std::string roleNameString;
@@ -1880,7 +1880,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
RoleName roleName;
@@ -2034,7 +2034,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = auth::parseDropAllRolesFromDatabaseCommand(cmdObj, dbname);
@@ -2177,7 +2177,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::RolesInfoArgs args;
@@ -2258,7 +2258,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
AuthorizationManager* authzManager = getGlobalAuthorizationManager();
@@ -2296,7 +2296,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
AuthorizationManager* authzManager = getGlobalAuthorizationManager();
@@ -2673,7 +2673,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::MergeAuthzCollectionsArgs args;
@@ -2914,7 +2914,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::AuthSchemaUpgradeArgs parsedArgs;
diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp
index 11a0806fbf9..6b3e76286a7 100644
--- a/src/mongo/db/commands/validate.cpp
+++ b/src/mongo/db/commands/validate.cpp
@@ -77,7 +77,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (MONGO_FAIL_POINT(validateCmdCollectionNotValid)) {
diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp
index a3ecd02b36a..f9e17234607 100644
--- a/src/mongo/db/commands/write_commands/write_commands.cpp
+++ b/src/mongo/db/commands/write_commands/write_commands.cpp
@@ -209,7 +209,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
try {
diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp
index e9f2c255375..8beaaad2076 100644
--- a/src/mongo/db/exec/stagedebug_cmd.cpp
+++ b/src/mongo/db/exec/stagedebug_cmd.cpp
@@ -139,7 +139,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BSONElement argElt = cmdObj["stageDebug"];
diff --git a/src/mongo/db/ftdc/ftdc_commands.cpp b/src/mongo/db/ftdc/ftdc_commands.cpp
index 23202624b60..5a20914982a 100644
--- a/src/mongo/db/ftdc/ftdc_commands.cpp
+++ b/src/mongo/db/ftdc/ftdc_commands.cpp
@@ -90,7 +90,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index 1e1ec17962c..cf0f351c12a 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -382,7 +382,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& ns,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
HandshakeArgs handshake;
diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp
index b2ab4c3bc04..35a9ad9491c 100644
--- a/src/mongo/db/repl/repl_set_commands.cpp
+++ b/src/mongo/db/repl/repl_set_commands.cpp
@@ -95,7 +95,7 @@ public:
CmdReplSetTest() : ReplSetCommand("replSetTest") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
log() << "replSetTest command received: " << cmdObj.toString();
@@ -163,7 +163,7 @@ public:
CmdReplSetGetRBID() : ReplSetCommand("replSetGetRBID") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -190,7 +190,7 @@ public:
CmdReplSetGetStatus() : ReplSetCommand("replSetGetStatus") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
if (cmdObj["forShell"].trueValue())
@@ -231,7 +231,7 @@ public:
CmdReplSetGetConfig() : ReplSetCommand("replSetGetConfig") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -330,7 +330,7 @@ public:
}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BSONObj configObj;
@@ -404,7 +404,7 @@ public:
CmdReplSetReconfig() : ReplSetCommand("replSetReconfig") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -460,7 +460,7 @@ public:
CmdReplSetFreeze() : ReplSetCommand("replSetFreeze") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -491,7 +491,7 @@ public:
CmdReplSetStepDown() : ReplSetCommand("replSetStepDown") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -556,7 +556,7 @@ public:
CmdReplSetMaintenance() : ReplSetCommand("replSetMaintenance") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -584,7 +584,7 @@ public:
CmdReplSetSyncFrom() : ReplSetCommand("replSetSyncFrom") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -612,7 +612,7 @@ public:
CmdReplSetUpdatePosition() : ReplSetCommand("replSetUpdatePosition") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auto replCoord = repl::ReplicationCoordinator::get(opCtx->getClient()->getServiceContext());
@@ -711,7 +711,7 @@ public:
CmdReplSetHeartbeat() : ReplSetCommand("replSetHeartbeat") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
MONGO_FAIL_POINT_BLOCK(rsDelayHeartbeatResponse, delay) {
@@ -797,7 +797,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -829,7 +829,7 @@ public:
private:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
DEV log() << "received elect msg " << cmdObj.toString();
@@ -862,7 +862,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
@@ -898,7 +898,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
diff --git a/src/mongo/db/repl/repl_set_request_votes.cpp b/src/mongo/db/repl/repl_set_request_votes.cpp
index 7c9ad65950b..7914e8aed01 100644
--- a/src/mongo/db/repl/repl_set_request_votes.cpp
+++ b/src/mongo/db/repl/repl_set_request_votes.cpp
@@ -49,7 +49,7 @@ public:
private:
bool run(OperationContext* opCtx,
const std::string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result);
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp
index dacefa5f72e..d91a80a58d9 100644
--- a/src/mongo/db/repl/replication_info.cpp
+++ b/src/mongo/db/repl/replication_info.cpp
@@ -233,7 +233,7 @@ public:
CmdIsMaster() : Command("isMaster", "ismaster") {}
virtual bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
/* currently request to arbiter is (somewhat arbitrarily) an ismaster request that is not
diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp
index d95ff87cc0f..e8876b47d4d 100644
--- a/src/mongo/db/repl/resync.cpp
+++ b/src/mongo/db/repl/resync.cpp
@@ -74,7 +74,7 @@ public:
CmdResync() : Command(kResyncFieldName) {}
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
bool waitForResync = !cmdObj.hasField(kWaitFieldName) || cmdObj[kWaitFieldName].trueValue();
diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp
index e274dbaa7a9..4917050f219 100644
--- a/src/mongo/db/s/check_sharding_index_command.cpp
+++ b/src/mongo/db/s/check_sharding_index_command.cpp
@@ -84,7 +84,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
std::string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss = NamespaceString(parseNs(dbname, jsobj));
diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
index 9327c1d551c..bf2b0046ca9 100644
--- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp
+++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
@@ -205,7 +205,7 @@ public:
bool run(OperationContext* opCtx,
string const& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
string ns;
diff --git a/src/mongo/db/s/config/configsvr_add_shard_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_command.cpp
index d6584229b25..72dea07a677 100644
--- a/src/mongo/db/s/config/configsvr_add_shard_command.cpp
+++ b/src/mongo/db/s/config/configsvr_add_shard_command.cpp
@@ -88,7 +88,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp
index 0b1791846d5..d8cd89547ec 100644
--- a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp
+++ b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp
@@ -89,7 +89,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp
index 5da0f7f9467..9a42c25f634 100644
--- a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp
+++ b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp
@@ -119,7 +119,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
diff --git a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp
index 0abcd7ebd70..7a896693887 100644
--- a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp
+++ b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp
@@ -74,7 +74,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
uassert(ErrorCodes::InternalError,
diff --git a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp
index 5d0c6a1c125..9b57c172e86 100644
--- a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp
+++ b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp
@@ -100,7 +100,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp
index 857dc043d0c..efd4c4c8710 100644
--- a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp
+++ b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp
@@ -80,7 +80,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
auto request = uassertStatusOK(BalanceChunkRequest::parseFromConfigCommand(cmdObj));
diff --git a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp
index 59846797124..5228635a599 100644
--- a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp
+++ b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp
@@ -89,7 +89,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp
index daba7456ed5..91e5ba98f2d 100644
--- a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp
+++ b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp
@@ -83,7 +83,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
const auto version = uassertStatusOK(
diff --git a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp
index ac7668c1a03..841e03a2a1e 100644
--- a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp
+++ b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp
@@ -98,7 +98,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp
index 2e253cf489e..f0b5328aedd 100644
--- a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp
+++ b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp
@@ -91,7 +91,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& unusedDbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
diff --git a/src/mongo/db/s/get_shard_version_command.cpp b/src/mongo/db/s/get_shard_version_command.cpp
index 68d7a4c70df..f1632fa7224 100644
--- a/src/mongo/db/s/get_shard_version_command.cpp
+++ b/src/mongo/db/s/get_shard_version_command.cpp
@@ -84,7 +84,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNs(dbname, cmdObj));
diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp
index 49bc379014a..6a3db0908ce 100644
--- a/src/mongo/db/s/merge_chunks_command.cpp
+++ b/src/mongo/db/s/merge_chunks_command.cpp
@@ -362,7 +362,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
uassertStatusOK(ShardingState::get(opCtx)->canAcceptShardedCommands());
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp
index d6cd3d89773..eeb12474948 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp
@@ -141,7 +141,7 @@ public:
bool run(OperationContext* opCtx,
const std::string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const MigrationSessionId migrationSessionId(
@@ -204,7 +204,7 @@ public:
bool run(OperationContext* opCtx,
const std::string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const MigrationSessionId migrationSessionId(
diff --git a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
index 383af210483..a188affcf43 100644
--- a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
+++ b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
@@ -86,7 +86,7 @@ public:
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auto shardingState = ShardingState::get(opCtx);
@@ -186,7 +186,7 @@ public:
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
ShardingState::get(opCtx)->migrationDestinationManager()->report(result);
@@ -226,7 +226,7 @@ public:
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auto const sessionId = uassertStatusOK(MigrationSessionId::extractFromBSON(cmdObj));
@@ -273,7 +273,7 @@ public:
bool run(OperationContext* opCtx,
const string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auto const mdm = ShardingState::get(opCtx)->migrationDestinationManager();
diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp
index 7f5500497d6..67edd9bb5af 100644
--- a/src/mongo/db/s/move_chunk_command.cpp
+++ b/src/mongo/db/s/move_chunk_command.cpp
@@ -114,7 +114,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
auto shardingState = ShardingState::get(opCtx);
diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp
index 178a22596d2..618604f10b3 100644
--- a/src/mongo/db/s/set_shard_version_command.cpp
+++ b/src/mongo/db/s/set_shard_version_command.cpp
@@ -90,7 +90,7 @@ public:
bool run(OperationContext* opCtx,
const std::string&,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
uassert(ErrorCodes::IllegalOperation,
diff --git a/src/mongo/db/s/sharding_state_command.cpp b/src/mongo/db/s/sharding_state_command.cpp
index cf483e80c98..21b12746c9f 100644
--- a/src/mongo/db/s/sharding_state_command.cpp
+++ b/src/mongo/db/s/sharding_state_command.cpp
@@ -69,7 +69,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
ShardingState::get(opCtx)->appendInfo(opCtx, result);
diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp
index 01e712cf95b..846d6ca4b87 100644
--- a/src/mongo/db/s/split_chunk_command.cpp
+++ b/src/mongo/db/s/split_chunk_command.cpp
@@ -169,7 +169,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
auto shardingState = ShardingState::get(opCtx);
diff --git a/src/mongo/db/s/split_vector_command.cpp b/src/mongo/db/s/split_vector_command.cpp
index 19f5951e616..309dddf1cfc 100644
--- a/src/mongo/db/s/split_vector_command.cpp
+++ b/src/mongo/db/s/split_vector_command.cpp
@@ -113,7 +113,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& jsobj,
+ const BSONObj& jsobj,
string& errmsg,
BSONObjBuilder& result) override {
//
diff --git a/src/mongo/db/s/unset_sharding_command.cpp b/src/mongo/db/s/unset_sharding_command.cpp
index d64b739f621..cb8e08a67b0 100644
--- a/src/mongo/db/s/unset_sharding_command.cpp
+++ b/src/mongo/db/s/unset_sharding_command.cpp
@@ -74,7 +74,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
ShardedConnectionInfo::reset(opCtx->getClient());
diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
index 23e59a9f065..950276ac9ae 100644
--- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
+++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
@@ -86,7 +86,7 @@ public:
std::vector<Privilege>* out) {}
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
boost::filesystem::path p = dur::getJournalDir();