summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/canonical_query_encoder_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/canonical_query_encoder_test.cpp')
-rw-r--r--src/mongo/db/query/canonical_query_encoder_test.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/db/query/canonical_query_encoder_test.cpp b/src/mongo/db/query/canonical_query_encoder_test.cpp
index f10c0c17e64..f54f7b7398b 100644
--- a/src/mongo/db/query/canonical_query_encoder_test.cpp
+++ b/src/mongo/db/query/canonical_query_encoder_test.cpp
@@ -55,15 +55,16 @@ unique_ptr<CanonicalQuery> canonicalize(BSONObj query,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = std::make_unique<QueryRequest>(nss);
- qr->setFilter(query);
- qr->setSort(sort);
- qr->setProj(proj);
- qr->setCollation(collation);
+ auto findCommand = std::make_unique<FindCommand>(nss);
+ findCommand->setFilter(query.getOwned());
+ findCommand->setSort(sort.getOwned());
+ findCommand->setProjection(proj.getOwned());
+ findCommand->setCollation(collation.getOwned());
const boost::intrusive_ptr<ExpressionContext> expCtx;
auto statusWithCQ =
CanonicalQuery::canonicalize(opCtx.get(),
- std::move(qr),
+ std::move(findCommand),
+ false,
expCtx,
ExtensionsCallbackNoop(),
MatchExpressionParser::kAllowAllSpecialFeatures);