summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_find.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r--src/mongo/s/query/cluster_find.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp
index 0cb7b9b8e31..7fac4105e93 100644
--- a/src/mongo/s/query/cluster_find.cpp
+++ b/src/mongo/s/query/cluster_find.cpp
@@ -160,7 +160,8 @@ StatusWith<std::unique_ptr<QueryRequest>> transformQueryForShards(
newQR->setSingleBatchField(false);
// Any expansion of the 'showRecordId' flag should have already happened on mongos.
- newQR->setShowRecordId(false);
+ if (newQR->showRecordId())
+ newQR->setShowRecordId(false);
invariant(newQR->validate());
return std::move(newQR);