summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
diff options
context:
space:
mode:
authorIsrael Hsu <israel.hsu@mongodb.com>2023-02-15 22:18:29 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-16 04:34:51 +0000
commit924f756576cfaad5a4253736394ae3e8973c79bb (patch)
treed895f49e0884fade8df5f349dd01e786602b432b /src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
parent2942a939de7e5c6a4fe0ea93fc3ae2fb2d815f75 (diff)
downloadmongo-924f756576cfaad5a4253736394ae3e8973c79bb.tar.gz
SERVER-70997 Implement query sampler counters for $currentOp
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.cpp3
1 files changed, 2 insertions, 1 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 52fae27f850..c0f9ca86f62 100644
--- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
+++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp
@@ -324,7 +324,8 @@ BSONObj prepareCmdObjForPassthrough(OperationContext* opCtx,
const boost::optional<ShardVersion>& shardVersion) {
BSONObj filteredCmdObj = CommandHelpers::filterCommandRequestForPassthrough(cmdObj);
if (!isExplain) {
- if (auto sampleId = analyze_shard_key::tryGenerateSampleId(opCtx, nss)) {
+ if (auto sampleId = analyze_shard_key::tryGenerateSampleId(
+ opCtx, nss, cmdObj.firstElementFieldNameStringData())) {
filteredCmdObj =
analyze_shard_key::appendSampleId(std::move(filteredCmdObj), std::move(*sampleId));
}