diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/exec/exclusion_projection_executor.h | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/exec/exclusion_projection_executor.h')
| -rw-r--r-- | src/mongo/db/exec/exclusion_projection_executor.h | 26 |
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), {}}; } |
