diff options
Diffstat (limited to 'src/mongo/db/exec/projection_node.h')
| -rw-r--r-- | src/mongo/db/exec/projection_node.h | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/mongo/db/exec/projection_node.h b/src/mongo/db/exec/projection_node.h index cd744ef4cac..2a587580330 100644 --- a/src/mongo/db/exec/projection_node.h +++ b/src/mongo/db/exec/projection_node.h @@ -29,9 +29,8 @@ #pragma once -#include <list> - #include "mongo/db/exec/projection_executor.h" + #include "mongo/db/query/projection_policies.h" namespace mongo::projection_executor { @@ -103,7 +102,7 @@ public: /** * Recursively report all paths that are referenced by this projection. */ - void reportProjectedPaths(OrderedPathSet* preservedPaths) const; + void reportProjectedPaths(std::set<std::string>* preservedPaths) const; /** * Return an optional number, x, which indicates that it is safe to stop reading the document @@ -120,7 +119,7 @@ public: * 'renamedPaths'. Each entry in 'renamedPaths' maps from the path's new name to its old name * prior to application of this projection. */ - void reportComputedPaths(OrderedPathSet* computedPaths, + void reportComputedPaths(std::set<std::string>* computedPaths, StringMap<std::string>* renamedPaths) const; const std::string& getPath() const { @@ -129,12 +128,10 @@ public: void optimize(); - Document serialize(boost::optional<ExplainOptions::Verbosity> explain, - const SerializationOptions& options) const; + Document serialize(boost::optional<ExplainOptions::Verbosity> explain) const; void serialize(boost::optional<ExplainOptions::Verbosity> explain, - MutableDocument* output, - const SerializationOptions& options) const; + MutableDocument* output) const; protected: /** @@ -163,19 +160,9 @@ protected: // Writes the given value to the output doc, replacing the existing value of 'field' if present. virtual void outputProjectedField(StringData field, Value val, MutableDocument* outDoc) const; - // Used to determine if the node is an inclusion or exclusion node. - virtual bool isIncluded() const = 0; - StringMap<std::unique_ptr<ProjectionNode>> _children; StringMap<boost::intrusive_ptr<Expression>> _expressions; - - // List of the projected fields in the order in which they were specified. - std::list<std::string> _projectedFields; - - // Set of projected fields. Note that the _projectedFields list actually owns the strings, and - // this StringDataSet simply holds views of those strings. - StringDataSet _projectedFieldsSet; - + StringSet _projectedFields; ProjectionPolicies _policies; std::string _pathToNode; |
