From b9f9195390142f4e1363dc83b986ead5dc8993b8 Mon Sep 17 00:00:00 2001 From: David Storch Date: Wed, 12 Apr 2017 14:53:25 -0400 Subject: SERVER-27115 extend $match swapping optimization to handle renamed fields If a field renamed by $project or $addFields is used in a subsequent $match, we can now swap the $match and update it to use the original (or, "renamed from") field name. This allows $match planning to result in better index usage in some cases. --- src/mongo/db/pipeline/document_source_sort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mongo/db/pipeline/document_source_sort.h') diff --git a/src/mongo/db/pipeline/document_source_sort.h b/src/mongo/db/pipeline/document_source_sort.h index 83af9a4bcb6..c3b1609b641 100644 --- a/src/mongo/db/pipeline/document_source_sort.h +++ b/src/mongo/db/pipeline/document_source_sort.h @@ -49,7 +49,7 @@ public: GetModPathsReturn getModifiedPaths() const final { // A $sort does not modify any paths. - return {GetModPathsReturn::Type::kFiniteSet, std::set{}}; + return {GetModPathsReturn::Type::kFiniteSet, std::set{}, {}}; } bool canSwapWithMatch() const final { -- cgit v1.2.1