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_replace_root.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mongo/db/pipeline/document_source_replace_root.cpp') diff --git a/src/mongo/db/pipeline/document_source_replace_root.cpp b/src/mongo/db/pipeline/document_source_replace_root.cpp index 521cf748784..8f6782dc47e 100644 --- a/src/mongo/db/pipeline/document_source_replace_root.cpp +++ b/src/mongo/db/pipeline/document_source_replace_root.cpp @@ -89,7 +89,7 @@ public: DocumentSource::GetModPathsReturn getModifiedPaths() const final { // Replaces the entire root, so all paths are modified. - return {DocumentSource::GetModPathsReturn::Type::kAllPaths, std::set{}}; + return {DocumentSource::GetModPathsReturn::Type::kAllPaths, std::set{}, {}}; } // Create the replaceRoot transformer. Uasserts on invalid input. -- cgit v1.2.1