summaryrefslogtreecommitdiff
path: root/src/mongo/s
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/s
parent4ec8e7a515ceb3e87b64ddde624404d1c4498066 (diff)
downloadmongo-9687c56dad047fb222076c0eb5fb25db6a796219.tar.gz
SERVER-29260 Make BSONObj argument to Command::run() const&
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/client/shard_connection.cpp2
-rw-r--r--src/mongo/s/commands/cluster_add_shard_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_apply_ops_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_available_query_options_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_compact_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_control_balancer_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_count_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_current_op.cpp2
-rw-r--r--src/mongo/s/commands/cluster_db_stats_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_drop_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_drop_database_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_enable_sharding_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_explain_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_find_and_modify_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_find_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_flush_router_config_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_fsync_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_ftdc_commands.cpp2
-rw-r--r--src/mongo/s/commands/cluster_get_last_error_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_get_prev_error_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_get_shard_map_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_get_shard_version_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_getmore_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_index_filter_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_is_db_grid_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_is_master_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_kill_op.cpp2
-rw-r--r--src/mongo/s/commands/cluster_list_databases_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_list_shards_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_map_reduce_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_merge_chunks_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_move_chunk_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_move_primary_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_netstat_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_pipeline_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_plan_cache_cmd.cpp4
-rw-r--r--src/mongo/s/commands/cluster_profile_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_remove_shard_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_reset_error_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_shard_collection_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_shutdown_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_split_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_user_management_commands.cpp38
-rw-r--r--src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_write_cmd.cpp2
-rw-r--r--src/mongo/s/commands/commands_public.cpp30
51 files changed, 84 insertions, 84 deletions
diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp
index c7fe4d56f43..5e68edaebab 100644
--- a/src/mongo/s/client/shard_connection.cpp
+++ b/src/mongo/s/client/shard_connection.cpp
@@ -113,7 +113,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- mongo::BSONObj& cmdObj,
+ const mongo::BSONObj& cmdObj,
std::string& errmsg,
mongo::BSONObjBuilder& result) {
// Connection information
diff --git a/src/mongo/s/commands/cluster_add_shard_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_cmd.cpp
index 15b20ae43e2..d85a4574f5c 100644
--- a/src/mongo/s/commands/cluster_add_shard_cmd.cpp
+++ b/src/mongo/s/commands/cluster_add_shard_cmd.cpp
@@ -82,7 +82,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto parsedRequest = uassertStatusOK(AddShardRequest::parseFromMongosCommand(cmdObj));
diff --git a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp
index a6981ccbaab..87e5db92d95 100644
--- a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp
+++ b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp
@@ -98,7 +98,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto parsedRequest = uassertStatusOK(AddShardToZoneRequest::parseFromMongosCommand(cmdObj));
diff --git a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp
index fd15a41f11f..25465129a2d 100644
--- a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp
+++ b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp
@@ -58,7 +58,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
uasserted(ErrorCodes::CommandNotSupported, "applyOps not allowed through mongos");
diff --git a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp
index 8db71cb997b..4acb791fee1 100644
--- a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp
+++ b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp
@@ -55,7 +55,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
result << "options" << QueryOption_AllSupportedForSharding;
diff --git a/src/mongo/s/commands/cluster_compact_cmd.cpp b/src/mongo/s/commands/cluster_compact_cmd.cpp
index ab0607ed626..deaa852c25a 100644
--- a/src/mongo/s/commands/cluster_compact_cmd.cpp
+++ b/src/mongo/s/commands/cluster_compact_cmd.cpp
@@ -59,7 +59,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
uasserted(ErrorCodes::CommandNotSupported, "compact not allowed through mongos");
diff --git a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
index 36a6a817620..268b80e5a8d 100644
--- a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
+++ b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
@@ -79,7 +79,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard();
diff --git a/src/mongo/s/commands/cluster_count_cmd.cpp b/src/mongo/s/commands/cluster_count_cmd.cpp
index 9f5d842fce9..e4f9a99a7ef 100644
--- a/src/mongo/s/commands/cluster_count_cmd.cpp
+++ b/src/mongo/s/commands/cluster_count_cmd.cpp
@@ -73,7 +73,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/s/commands/cluster_current_op.cpp b/src/mongo/s/commands/cluster_current_op.cpp
index 009fb1d9ae2..69a4198abeb 100644
--- a/src/mongo/s/commands/cluster_current_op.cpp
+++ b/src/mongo/s/commands/cluster_current_op.cpp
@@ -82,7 +82,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& output) override {
auto shardResponses =
diff --git a/src/mongo/s/commands/cluster_db_stats_cmd.cpp b/src/mongo/s/commands/cluster_db_stats_cmd.cpp
index f89e54365ef..9e101dd4ff0 100644
--- a/src/mongo/s/commands/cluster_db_stats_cmd.cpp
+++ b/src/mongo/s/commands/cluster_db_stats_cmd.cpp
@@ -65,7 +65,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& output) override {
auto shardResponses =
diff --git a/src/mongo/s/commands/cluster_drop_cmd.cpp b/src/mongo/s/commands/cluster_drop_cmd.cpp
index 20a2932ca8d..bb7508c9194 100644
--- a/src/mongo/s/commands/cluster_drop_cmd.cpp
+++ b/src/mongo/s/commands/cluster_drop_cmd.cpp
@@ -73,7 +73,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
diff --git a/src/mongo/s/commands/cluster_drop_database_cmd.cpp b/src/mongo/s/commands/cluster_drop_database_cmd.cpp
index 5d88ed0fa2e..9a1dacd7539 100644
--- a/src/mongo/s/commands/cluster_drop_database_cmd.cpp
+++ b/src/mongo/s/commands/cluster_drop_database_cmd.cpp
@@ -72,7 +72,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
uassert(ErrorCodes::IllegalOperation,
diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
index f3e9b7368e5..a30686735d8 100644
--- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
+++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
@@ -88,7 +88,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname_unused,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const std::string dbname = parseNs("", cmdObj);
diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp
index 102609e18d9..2fa4184a5c0 100644
--- a/src/mongo/s/commands/cluster_explain_cmd.cpp
+++ b/src/mongo/s/commands/cluster_explain_cmd.cpp
@@ -107,7 +107,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/s/commands/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
index 225567b3ebd..3e9054027e1 100644
--- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
+++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
@@ -156,7 +156,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss = parseNsCollectionRequired(dbName, cmdObj);
diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp
index 80e9508ae55..16c84ab5c27 100644
--- a/src/mongo/s/commands/cluster_find_cmd.cpp
+++ b/src/mongo/s/commands/cluster_find_cmd.cpp
@@ -151,7 +151,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
// We count find command as a query op.
diff --git a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp
index 5d36aba4723..30e7d6eb423 100644
--- a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp
+++ b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp
@@ -66,7 +66,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
Grid::get(opCtx)->catalogCache()->purgeAllDatabases();
diff --git a/src/mongo/s/commands/cluster_fsync_cmd.cpp b/src/mongo/s/commands/cluster_fsync_cmd.cpp
index 28b907a061d..69177cfb1a1 100644
--- a/src/mongo/s/commands/cluster_fsync_cmd.cpp
+++ b/src/mongo/s/commands/cluster_fsync_cmd.cpp
@@ -69,7 +69,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
if (cmdObj["lock"].trueValue()) {
diff --git a/src/mongo/s/commands/cluster_ftdc_commands.cpp b/src/mongo/s/commands/cluster_ftdc_commands.cpp
index 9a29384298b..f097353d1dc 100644
--- a/src/mongo/s/commands/cluster_ftdc_commands.cpp
+++ b/src/mongo/s/commands/cluster_ftdc_commands.cpp
@@ -72,7 +72,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/s/commands/cluster_get_last_error_cmd.cpp b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp
index 39eb26a61f6..a54c380a685 100644
--- a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp
+++ b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp
@@ -208,7 +208,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
// Mongos GLE - finicky.
diff --git a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp
index 97d96e3e322..7fdcfdb80f1 100644
--- a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp
+++ b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp
@@ -63,7 +63,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
errmsg += "getpreverror not supported for sharded environments";
diff --git a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp
index 69c9ee9f1dc..0917bdb90b2 100644
--- a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp
+++ b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp
@@ -69,7 +69,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
// MongoD instances do not know that they are part of a sharded cluster until they
diff --git a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp
index 5280fdb44c3..d5b627b5de5 100644
--- a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp
+++ b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp
@@ -81,7 +81,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/s/commands/cluster_getmore_cmd.cpp b/src/mongo/s/commands/cluster_getmore_cmd.cpp
index 8d01a481f11..344841075e5 100644
--- a/src/mongo/s/commands/cluster_getmore_cmd.cpp
+++ b/src/mongo/s/commands/cluster_getmore_cmd.cpp
@@ -93,7 +93,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
// Counted as a getMore, not as a command.
diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp
index 73f1f9cfe0f..e96ccec8822 100644
--- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp
+++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp
@@ -93,7 +93,7 @@ public:
// Cluster plan cache command entry point.
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNs(dbname, cmdObj));
diff --git a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp
index 57e7b579e41..07527f725c3 100644
--- a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp
+++ b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp
@@ -54,7 +54,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
result.append("isdbgrid", 1);
diff --git a/src/mongo/s/commands/cluster_is_master_cmd.cpp b/src/mongo/s/commands/cluster_is_master_cmd.cpp
index afda930a308..1c1be0b9a53 100644
--- a/src/mongo/s/commands/cluster_is_master_cmd.cpp
+++ b/src/mongo/s/commands/cluster_is_master_cmd.cpp
@@ -69,7 +69,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
diff --git a/src/mongo/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp
index 653a19a152d..470031073c9 100644
--- a/src/mongo/s/commands/cluster_kill_op.cpp
+++ b/src/mongo/s/commands/cluster_kill_op.cpp
@@ -78,7 +78,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& db,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) final {
// The format of op is shardid:opid
diff --git a/src/mongo/s/commands/cluster_list_databases_cmd.cpp b/src/mongo/s/commands/cluster_list_databases_cmd.cpp
index e856bad19b3..68c9cd55581 100644
--- a/src/mongo/s/commands/cluster_list_databases_cmd.cpp
+++ b/src/mongo/s/commands/cluster_list_databases_cmd.cpp
@@ -85,7 +85,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname_unused,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const bool nameOnly = cmdObj["nameOnly"].trueValue();
diff --git a/src/mongo/s/commands/cluster_list_shards_cmd.cpp b/src/mongo/s/commands/cluster_list_shards_cmd.cpp
index 0487aefdf7f..d9ca47830fc 100644
--- a/src/mongo/s/commands/cluster_list_shards_cmd.cpp
+++ b/src/mongo/s/commands/cluster_list_shards_cmd.cpp
@@ -70,7 +70,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto shardsStatus = grid.catalogClient(opCtx)->getAllShards(
diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp
index 8a7ab425ae1..444a37e3b38 100644
--- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp
+++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp
@@ -178,7 +178,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
Timer t;
diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
index 37c0bfeba59..c4ec3a5e2bb 100644
--- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
+++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
@@ -101,7 +101,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNs(dbname, cmdObj));
diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
index 6b289532d86..06659861cc7 100644
--- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
+++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp
@@ -97,7 +97,7 @@ public:
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) override {
Timer t;
diff --git a/src/mongo/s/commands/cluster_move_primary_cmd.cpp b/src/mongo/s/commands/cluster_move_primary_cmd.cpp
index aeafb592e7b..1d1c6b364cc 100644
--- a/src/mongo/s/commands/cluster_move_primary_cmd.cpp
+++ b/src/mongo/s/commands/cluster_move_primary_cmd.cpp
@@ -102,7 +102,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname_unused,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
const string dbname = parseNs("", cmdObj);
diff --git a/src/mongo/s/commands/cluster_netstat_cmd.cpp b/src/mongo/s/commands/cluster_netstat_cmd.cpp
index cffd4605833..61d19c1f408 100644
--- a/src/mongo/s/commands/cluster_netstat_cmd.cpp
+++ b/src/mongo/s/commands/cluster_netstat_cmd.cpp
@@ -67,7 +67,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
result.append("configserver",
diff --git a/src/mongo/s/commands/cluster_pipeline_cmd.cpp b/src/mongo/s/commands/cluster_pipeline_cmd.cpp
index 25bee7dc634..83df03ca48e 100644
--- a/src/mongo/s/commands/cluster_pipeline_cmd.cpp
+++ b/src/mongo/s/commands/cluster_pipeline_cmd.cpp
@@ -68,7 +68,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/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
index 87beef74b24..105dd44f746 100644
--- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
+++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
@@ -88,7 +88,7 @@ public:
// Cluster plan cache command entry point.
bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result);
@@ -111,7 +111,7 @@ private:
bool ClusterPlanCacheCmd::run(OperationContext* opCtx,
const std::string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errMsg,
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
diff --git a/src/mongo/s/commands/cluster_profile_cmd.cpp b/src/mongo/s/commands/cluster_profile_cmd.cpp
index 5b4197062e8..9927ba08a65 100644
--- a/src/mongo/s/commands/cluster_profile_cmd.cpp
+++ b/src/mongo/s/commands/cluster_profile_cmd.cpp
@@ -60,7 +60,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
errmsg = "profile currently not supported via mongos";
diff --git a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
index c3f819856e9..96376ad2702 100644
--- a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
+++ b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
@@ -81,7 +81,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
uassert(ErrorCodes::TypeMismatch,
diff --git a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp
index cfd072b88ef..26ba207131b 100644
--- a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp
+++ b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp
@@ -105,7 +105,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto parsedRequest =
diff --git a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp
index 66c7f6722d8..8dbb0411d14 100644
--- a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp
+++ b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp
@@ -66,7 +66,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
if (cmdObj["forShell"].trueValue()) {
diff --git a/src/mongo/s/commands/cluster_reset_error_cmd.cpp b/src/mongo/s/commands/cluster_reset_error_cmd.cpp
index e013c474e7e..7844ac44a27 100644
--- a/src/mongo/s/commands/cluster_reset_error_cmd.cpp
+++ b/src/mongo/s/commands/cluster_reset_error_cmd.cpp
@@ -61,7 +61,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
LastError::get(cc()).reset();
diff --git a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
index 271ceb7faee..9782f1f05bf 100644
--- a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
+++ b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
@@ -85,7 +85,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/s/commands/cluster_shard_collection_cmd.cpp b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp
index a4f7519f176..1d0a1970c75 100644
--- a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp
+++ b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp
@@ -159,7 +159,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/s/commands/cluster_shutdown_cmd.cpp b/src/mongo/s/commands/cluster_shutdown_cmd.cpp
index f429afef8c2..fde7564a285 100644
--- a/src/mongo/s/commands/cluster_shutdown_cmd.cpp
+++ b/src/mongo/s/commands/cluster_shutdown_cmd.cpp
@@ -43,7 +43,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
// Never returns
diff --git a/src/mongo/s/commands/cluster_split_cmd.cpp b/src/mongo/s/commands/cluster_split_cmd.cpp
index 01f2b8430e3..4e18ab31d9a 100644
--- a/src/mongo/s/commands/cluster_split_cmd.cpp
+++ b/src/mongo/s/commands/cluster_split_cmd.cpp
@@ -125,7 +125,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/s/commands/cluster_update_zone_key_range_cmd.cpp b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp
index 56647dff7ef..c27f6f78a02 100644
--- a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp
+++ b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp
@@ -120,7 +120,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
auto parsedRequest =
diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp
index 7a569094447..dfa2233c57f 100644
--- a/src/mongo/s/commands/cluster_user_management_commands.cpp
+++ b/src/mongo/s/commands/cluster_user_management_commands.cpp
@@ -88,7 +88,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -126,7 +126,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
auth::CreateOrUpdateUserArgs args;
@@ -175,7 +175,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
UserName userName;
@@ -220,7 +220,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -260,7 +260,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
string userNameString;
@@ -307,7 +307,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
string userNameString;
@@ -358,7 +358,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementReadCommand(
@@ -392,7 +392,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -426,7 +426,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -466,7 +466,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -506,7 +506,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -546,7 +546,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -586,7 +586,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -629,7 +629,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -673,7 +673,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -717,7 +717,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementReadCommand(
@@ -755,7 +755,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
AuthorizationManager* authzManager = getGlobalAuthorizationManager();
@@ -805,7 +805,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand(
@@ -894,7 +894,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
// Run the authSchemaUpgrade command on the config servers
diff --git a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp
index 9ca29ed3d7d..207a30c38ee 100644
--- a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp
+++ b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp
@@ -59,7 +59,7 @@ public:
virtual bool run(OperationContext* opCtx,
const std::string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& result) {
result << "you" << cc().getRemote().toString();
diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp
index 96d40270a32..7569deb9504 100644
--- a/src/mongo/s/commands/cluster_write_cmd.cpp
+++ b/src/mongo/s/commands/cluster_write_cmd.cpp
@@ -129,7 +129,7 @@ public:
virtual bool run(OperationContext* opCtx,
const string& dbname,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) {
BatchedCommandRequest request(_writeType);
diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp
index f9b72616638..a946334b517 100644
--- a/src/mongo/s/commands/commands_public.cpp
+++ b/src/mongo/s/commands/commands_public.cpp
@@ -212,7 +212,7 @@ protected:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& output) override {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
@@ -246,7 +246,7 @@ protected:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNs(dbName, cmdObj));
@@ -352,7 +352,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& output) {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
@@ -423,7 +423,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
uassertStatusOK(createShardDatabase(opCtx, dbName));
@@ -455,7 +455,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const auto fullNsFromElt = cmdObj.firstElement();
@@ -513,7 +513,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const auto todbElt = cmdObj["todb"];
@@ -586,7 +586,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
@@ -766,7 +766,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNs(dbName, cmdObj));
@@ -959,7 +959,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const std::string ns = parseNs(dbName, cmdObj);
@@ -994,7 +994,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
@@ -1240,7 +1240,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNs(dbName, cmdObj));
@@ -1382,7 +1382,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));
@@ -1519,7 +1519,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) override {
RARELY {
@@ -1564,7 +1564,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) final {
auto nss = NamespaceString::makeListCollectionsNSS(dbName);
@@ -1613,7 +1613,7 @@ public:
bool run(OperationContext* opCtx,
const string& dbName,
- BSONObj& cmdObj,
+ const BSONObj& cmdObj,
string& errmsg,
BSONObjBuilder& result) final {
const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj));