From 1b75fcdcaf9c320ef8b916204d1eb51c4bab8a5f Mon Sep 17 00:00:00 2001 From: David Storch Date: Wed, 18 Dec 2019 03:28:25 +0000 Subject: 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. --- src/mongo/db/query/query_request.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/mongo/db/query/query_request.h') diff --git a/src/mongo/db/query/query_request.h b/src/mongo/db/query/query_request.h index 1457480b3dd..ae2ed26036b 100644 --- a/src/mongo/db/query/query_request.h +++ b/src/mongo/db/query/query_request.h @@ -109,15 +109,6 @@ public: */ static bool isTextScoreMeta(BSONElement elt); - /** - * Helper function to validate a sort object. - * Returns true if each element satisfies one of: - * 1. a number with value 1 - * 2. a number with value -1 - * 3. isTextScoreMeta - */ - static bool isValidSortOrder(const BSONObj& sortObj); - // Read preference is attached to commands in "wrapped" form, e.g. // { $query: { : ... } , : { ... } } // -- cgit v1.2.1