diff options
Diffstat (limited to 'src/mongo/s/shard_key_pattern.cpp')
-rw-r--r-- | src/mongo/s/shard_key_pattern.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp index cb9b0883ff9..baefac56f4f 100644 --- a/src/mongo/s/shard_key_pattern.cpp +++ b/src/mongo/s/shard_key_pattern.cpp @@ -283,8 +283,14 @@ StatusWith<BSONObj> ShardKeyPattern::extractShardKeyFromQuery(OperationContext* auto qr = stdx::make_unique<QueryRequest>(NamespaceString("")); qr->setFilter(basicQuery); + const boost::intrusive_ptr<ExpressionContext> expCtx; auto statusWithCQ = - CanonicalQuery::canonicalize(opCtx, std::move(qr), ExtensionsCallbackNoop()); + CanonicalQuery::canonicalize(opCtx, + std::move(qr), + expCtx, + ExtensionsCallbackNoop(), + MatchExpressionParser::kAllowAllSpecialFeatures & + ~MatchExpressionParser::AllowedFeatures::kExpr); if (!statusWithCQ.isOK()) { return StatusWith<BSONObj>(statusWithCQ.getStatus()); } |