summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_sort.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2017-04-12 14:53:25 -0400
committerDavid Storch <david.storch@10gen.com>2017-04-18 18:11:15 -0400
commitb9f9195390142f4e1363dc83b986ead5dc8993b8 (patch)
treed57f4c4643a64d3e64720a90560cc511dd8b5467 /src/mongo/db/pipeline/document_source_sort.h
parent071d0398b7e527fc5b8c1ffdd3474c91f34616f0 (diff)
downloadmongo-b9f9195390142f4e1363dc83b986ead5dc8993b8.tar.gz
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.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_sort.h')
-rw-r--r--src/mongo/db/pipeline/document_source_sort.h2
1 files changed, 1 insertions, 1 deletions
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<std::string>{}};
+ return {GetModPathsReturn::Type::kFiniteSet, std::set<std::string>{}, {}};
}
bool canSwapWithMatch() const final {