diff options
author | Ruoxin Xu <ruoxin.xu@mongodb.com> | 2021-02-02 21:03:25 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-17 11:23:05 +0000 |
commit | 5ada96cbe318734f9c7dfa26dea3f28dbe4627bf (patch) | |
tree | 5a63211f065b1e40e5eeeb239d241355e1720ffa /src/mongo/s/shard_key_pattern.cpp | |
parent | d4ff82a11019aef87701db9053499461601e75d6 (diff) | |
download | mongo-5ada96cbe318734f9c7dfa26dea3f28dbe4627bf.tar.gz |
SERVER-53060 Remove QueryRequest class
Diffstat (limited to 'src/mongo/s/shard_key_pattern.cpp')
-rw-r--r-- | src/mongo/s/shard_key_pattern.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp index 94e6db3dbea..96156876552 100644 --- a/src/mongo/s/shard_key_pattern.cpp +++ b/src/mongo/s/shard_key_pattern.cpp @@ -390,13 +390,14 @@ BSONObj ShardKeyPattern::emplaceMissingShardKeyValuesForDocument(const BSONObj d StatusWith<BSONObj> ShardKeyPattern::extractShardKeyFromQuery(OperationContext* opCtx, const NamespaceString& nss, const BSONObj& basicQuery) const { - auto qr = std::make_unique<QueryRequest>(nss); - qr->setFilter(basicQuery); + auto findCommand = std::make_unique<FindCommand>(nss); + findCommand->setFilter(basicQuery.getOwned()); const boost::intrusive_ptr<ExpressionContext> expCtx; auto statusWithCQ = CanonicalQuery::canonicalize(opCtx, - std::move(qr), + std::move(findCommand), + false, /* isExplain */ expCtx, ExtensionsCallbackNoop(), MatchExpressionParser::kAllowAllSpecialFeatures); @@ -409,15 +410,16 @@ StatusWith<BSONObj> ShardKeyPattern::extractShardKeyFromQuery(OperationContext* StatusWith<BSONObj> ShardKeyPattern::extractShardKeyFromQuery( boost::intrusive_ptr<ExpressionContext> expCtx, const BSONObj& basicQuery) const { - auto qr = std::make_unique<QueryRequest>(expCtx->ns); - qr->setFilter(basicQuery); + auto findCommand = std::make_unique<FindCommand>(expCtx->ns); + findCommand->setFilter(basicQuery.getOwned()); if (!expCtx->getCollatorBSON().isEmpty()) { - qr->setCollation(expCtx->getCollatorBSON()); + findCommand->setCollation(expCtx->getCollatorBSON().getOwned()); } auto statusWithCQ = CanonicalQuery::canonicalize(expCtx->opCtx, - std::move(qr), + std::move(findCommand), + false, /* isExplain */ expCtx, ExtensionsCallbackNoop(), MatchExpressionParser::kAllowAllSpecialFeatures); |