summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_planner_tree_test.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2019-12-18 03:28:25 +0000
committerevergreen <evergreen@mongodb.com>2019-12-18 03:28:25 +0000
commit1b75fcdcaf9c320ef8b916204d1eb51c4bab8a5f (patch)
tree237bb5cddc47f6918992d10f343ede42acf204e0 /src/mongo/db/query/query_planner_tree_test.cpp
parente83c51c61fa9907459e1cfac9e4bb3517445612f (diff)
downloadmongo-1b75fcdcaf9c320ef8b916204d1eb51c4bab8a5f.tar.gz
SERVER-43816 Push $text and $meta:"textScore" sort into the PlanStage layer.
This change involves unifying the behavior of find and agg for validation of $meta:"textScore". In particular, find operations no longer require a "textScore" $meta projection in order to specify a "textScore" $meta sort. This brings find into alignment with agg, which never had such a restriction. It is also now legal for a find command to sort on the field overridden by a $meta:"textScore" projection without specifying the $meta operator in the sort pattern. In addition: - Tightens validation around uses of "textScore" $meta projections for queries that do not specify a $text predicate. - Fixes a bug in which $natural sort/hint were not correctly validated.
Diffstat (limited to 'src/mongo/db/query/query_planner_tree_test.cpp')
-rw-r--r--src/mongo/db/query/query_planner_tree_test.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/mongo/db/query/query_planner_tree_test.cpp b/src/mongo/db/query/query_planner_tree_test.cpp
index e875163254d..a5c68dd6c03 100644
--- a/src/mongo/db/query/query_planner_tree_test.cpp
+++ b/src/mongo/db/query/query_planner_tree_test.cpp
@@ -815,20 +815,6 @@ TEST_F(QueryPlannerTest, TooManyToExplode) {
"{pattern: {a: 1, b: 1, c:1, d:1}}}}}}}}}");
}
-TEST_F(QueryPlannerTest, CantExplodeMetaSort) {
- addIndex(BSON("a" << 1 << "b" << 1 << "c"
- << "text"));
- runQuerySortProj(fromjson("{a: {$in: [1, 2]}, b: {$in: [3, 4]}}"),
- fromjson("{c: {$meta: 'textScore'}}"),
- fromjson("{c: {$meta: 'textScore'}}"));
-
- assertNumSolutions(1U);
- assertSolutionExists(
- "{proj: {spec: {c:{$meta:'textScore'}}, node: "
- "{sort: {pattern: {c:{$meta:'textScore'}}, limit: 0, node: {sortKeyGen: {node: "
- "{cscan: {filter: {a:{$in:[1,2]},b:{$in:[3,4]}}, dir: 1}}}}}}}}");
-}
-
// SERVER-13618: test that exploding scans for sort works even
// if we must reverse the scan direction.
TEST_F(QueryPlannerTest, ExplodeMustReverseScans) {