summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/distinct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/distinct.cpp')
-rw-r--r--src/mongo/db/commands/distinct.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp
index f261336321f..78c835cb68d 100644
--- a/src/mongo/db/commands/distinct.cpp
+++ b/src/mongo/db/commands/distinct.cpp
@@ -206,10 +206,7 @@ public:
"Cannot run 'distinct' on a sharded collection in a multi-document transaction. "
"Please see http://dochub.mongodb.org/core/transaction-distinct for a recommended "
"alternative.",
- !opCtx->inMultiDocumentTransaction() ||
- !CollectionShardingState::get(opCtx, nss)
- ->getCollectionDescription(opCtx)
- .isSharded());
+ !opCtx->inMultiDocumentTransaction() || !ctx->getCollection().isSharded());
}
const ExtensionsCallbackReal extensionsCallback(opCtx, &nss);