summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/projection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/projection.h')
-rw-r--r--src/mongo/db/query/projection.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mongo/db/query/projection.h b/src/mongo/db/query/projection.h
index 95d41caba02..914567e87ed 100644
--- a/src/mongo/db/query/projection.h
+++ b/src/mongo/db/query/projection.h
@@ -49,7 +49,7 @@ struct ProjectionDependencies {
bool containsElemMatch = false;
// Which fields are necessary to perform the projection, or boost::none if all are required.
- boost::optional<OrderedPathSet> requiredFields;
+ boost::optional<std::set<std::string>> requiredFields;
bool hasDottedPath = false;
@@ -95,7 +95,7 @@ public:
* Return which fields are required to compute the projection, assuming the entire document is
* not needed.
*/
- const OrderedPathSet& getRequiredFields() const {
+ const std::set<std::string>& getRequiredFields() const {
invariant(_type == ProjectType::kInclusion);
return *_deps.requiredFields;
}
@@ -142,25 +142,14 @@ public:
return _deps.containsElemMatch;
}
- /**
- * Optimizes the projection tree. Additionally, re-computes dependencies in case anything
- * changes as in projection {x: {$and: [false, "$b"]}} - which when optimized will no longer
- * depend on "b".
- */
- void optimize();
-
private:
ProjectionPathASTNode _root;
ProjectType _type;
ProjectionDependencies _deps;
- bool _projOptimized = false;
};
/**
- * Walks the projection AST and optimizes each node. Note if you have a 'Projection' instance you
- * should prefer to use Projection::optimize() since it will additionally re-compute dependencies in
- * case anything changes as in projection {x: {$and: [false, "$b"]}} - which when optimized will no
- * longer depend on "b".
+ * Walks the projection AST and optimizes each node.
*/
void optimizeProjection(ProjectionPathASTNode* root);