summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/exclusion_projection_executor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/exclusion_projection_executor.h')
-rw-r--r--src/mongo/db/exec/exclusion_projection_executor.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/mongo/db/exec/exclusion_projection_executor.h b/src/mongo/db/exec/exclusion_projection_executor.h
index 37623206723..a9c1fade72d 100644
--- a/src/mongo/db/exec/exclusion_projection_executor.h
+++ b/src/mongo/db/exec/exclusion_projection_executor.h
@@ -86,9 +86,6 @@ protected:
Value transformSkippedValueForOutput(const Value& value) const final {
return value;
}
- bool isIncluded() const final {
- return false;
- }
};
/**
@@ -99,12 +96,10 @@ protected:
*/
class ExclusionProjectionExecutor : public ProjectionExecutor {
public:
- ExclusionProjectionExecutor(
- const boost::intrusive_ptr<ExpressionContext>& expCtx,
- ProjectionPolicies policies,
- bool allowFastPath = false,
- boost::optional<projection_ast::ProjectionPathASTNode> proj = boost::none)
- : ProjectionExecutor(expCtx, policies, proj), _root(new ExclusionNode(_policies)) {}
+ ExclusionProjectionExecutor(const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ ProjectionPolicies policies,
+ bool allowFastPath = false)
+ : ProjectionExecutor(expCtx, policies), _root(new ExclusionNode(_policies)) {}
TransformerType getType() const final {
return TransformerType::kExclusionProjection;
@@ -118,17 +113,16 @@ public:
return _root.get();
}
- Document serializeTransformation(boost::optional<ExplainOptions::Verbosity> explain,
- const SerializationOptions& options = {}) const final {
+ Document serializeTransformation(
+ boost::optional<ExplainOptions::Verbosity> explain) const final {
MutableDocument output;
// The ExclusionNode tree in '_root' will always have a top-level _id node if _id is to be
// excluded. If the _id node is not present, then explicitly set {_id: true} to avoid
// ambiguity in the expected behavior of the serialized projection.
- _root->serialize(explain, &output, options);
- auto idFieldName = options.serializeFieldPath("_id");
- if (output.peek()[idFieldName].missing()) {
- output.addField(idFieldName, Value{true});
+ _root->serialize(explain, &output);
+ if (output.peek()["_id"].missing()) {
+ output.addField("_id", Value{true});
}
return output.freeze();
}
@@ -155,7 +149,7 @@ public:
return {DocumentSource::GetModPathsReturn::Type::kAllPaths, {}, {}};
}
- OrderedPathSet modifiedPaths;
+ std::set<std::string> modifiedPaths;
_root->reportProjectedPaths(&modifiedPaths);
return {DocumentSource::GetModPathsReturn::Type::kFiniteSet, std::move(modifiedPaths), {}};
}