diff options
Diffstat (limited to 'src/mongo/s/commands/cluster_find_and_modify_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_find_and_modify_cmd.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 8393517bac7..75347473ce3 100644 --- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp @@ -105,7 +105,7 @@ public: Status explain(OperationContext* opCtx, const OpMsgRequest& request, ExplainOptions::Verbosity verbosity, - BSONObjBuilder* out) const override { + rpc::ReplyBuilderInterface* result) const override { std::string dbName = request.getDatabase().toString(); const BSONObj& cmdObj = request.body; const NamespaceString nss(CommandHelpers::parseNsCollectionRequired(dbName, cmdObj)); @@ -134,25 +134,26 @@ public: // Time how long it takes to run the explain command on the shard. Timer timer; - BSONObjBuilder result; + BSONObjBuilder bob; _runCommand(opCtx, shard->getId(), (chunkMgr ? chunkMgr->getVersion(shard->getId()) : ChunkVersion::UNSHARDED()), nss, explainCmd, - &result); + &bob); const auto millisElapsed = timer.millis(); Strategy::CommandResult cmdResult; cmdResult.shardTargetId = shard->getId(); cmdResult.target = shard->getConnString(); - cmdResult.result = result.obj(); + cmdResult.result = bob.obj(); std::vector<Strategy::CommandResult> shardResults; shardResults.push_back(cmdResult); + auto bodyBuilder = result->getBodyBuilder(); return ClusterExplain::buildExplainResult( - opCtx, shardResults, ClusterExplain::kSingleShard, millisElapsed, out); + opCtx, shardResults, ClusterExplain::kSingleShard, millisElapsed, &bodyBuilder); } bool run(OperationContext* opCtx, |