diff options
author | James Wahlin <james.wahlin@10gen.com> | 2017-05-08 16:36:32 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2017-05-09 06:50:30 -0400 |
commit | 79c2c2d340982da8b669cd7c3aa6b958dbf56263 (patch) | |
tree | 638966f593b22a6e3a1de2851a4e1df2959480bb /src/mongo/db/pipeline/expression.h | |
parent | 7d90084649608b3acc35ea290cce879783df12dc (diff) | |
download | mongo-79c2c2d340982da8b669cd7c3aa6b958dbf56263.tar.gz |
SERVER-28651 Don't hold Document ref across group iterationsr3.5.7
Diffstat (limited to 'src/mongo/db/pipeline/expression.h')
-rw-r--r-- | src/mongo/db/pipeline/expression.h | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h index d698fd127f7..124e4916c1d 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -105,7 +105,7 @@ public: /** * Evaluate expression with respect to the Document given by 'root', and return the result. */ - virtual Value evaluate(Document root) const = 0; + virtual Value evaluate(const Document& root) const = 0; /** * Parses a BSON Object that could represent an object literal or a functional expression like @@ -300,7 +300,7 @@ public: explicit ExpressionFromAccumulator(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionFromAccumulator<Accumulator>>(expCtx) {} - Value evaluate(Document root) const final { + Value evaluate(const Document& root) const final { Accumulator accum(this->getExpressionContext()); const size_t n = this->vpOperand.size(); // If a single array arg is given, loop through it passing each member to the accumulator. @@ -352,7 +352,7 @@ public: virtual ~ExpressionSingleNumericArg() {} - Value evaluate(Document root) const final { + Value evaluate(const Document& root) const final { Value arg = this->vpOperand[0]->evaluate(root); if (arg.nullish()) return Value(BSONNULL); @@ -384,7 +384,7 @@ public: explicit ExpressionAdd(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionAdd>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -402,7 +402,7 @@ public: explicit ExpressionAllElementsTrue(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionAllElementsTrue, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -413,7 +413,7 @@ public: : ExpressionVariadic<ExpressionAnd>(expCtx) {} boost::intrusive_ptr<Expression> optimize() final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -431,7 +431,7 @@ public: explicit ExpressionAnyElementTrue(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionAnyElementTrue, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -441,7 +441,7 @@ public: explicit ExpressionArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionArray>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; Value serialize(bool explain) const final; const char* getOpName() const final; }; @@ -452,7 +452,7 @@ public: explicit ExpressionArrayElemAt(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionArrayElemAt, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -461,7 +461,7 @@ public: explicit ExpressionObjectToArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionObjectToArray, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -470,7 +470,7 @@ public: explicit ExpressionArrayToObject(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionArrayToObject, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -488,7 +488,7 @@ class ExpressionCoerceToBool final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; Value serialize(bool explain) const final; static boost::intrusive_ptr<ExpressionCoerceToBool> create( @@ -522,7 +522,7 @@ public: ExpressionCompare(const boost::intrusive_ptr<ExpressionContext>& expCtx, CmpOp cmpOp) : ExpressionFixedArity<ExpressionCompare, 2>(expCtx), cmpOp(cmpOp) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static boost::intrusive_ptr<Expression> parse( @@ -547,7 +547,7 @@ public: explicit ExpressionConcat(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionConcat>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -561,7 +561,7 @@ public: explicit ExpressionConcatArrays(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionConcatArrays>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -574,7 +574,7 @@ class ExpressionCond final : public ExpressionFixedArity<ExpressionCond, 3> { public: explicit ExpressionCond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : Base(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static boost::intrusive_ptr<Expression> parse( @@ -591,7 +591,7 @@ class ExpressionConstant final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; Value serialize(bool explain) const final; const char* getOpName() const; @@ -623,7 +623,7 @@ class ExpressionDateToString final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -654,7 +654,7 @@ public: explicit ExpressionDayOfMonth(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfMonth, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -668,7 +668,7 @@ public: explicit ExpressionDayOfWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfWeek, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; // MySQL uses 1-7, tm uses 0-6 @@ -683,7 +683,7 @@ public: explicit ExpressionDayOfYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfYear, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; // MySQL uses 1-366, tm uses 0-365 @@ -698,7 +698,7 @@ public: explicit ExpressionDivide(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDivide, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -717,7 +717,7 @@ class ExpressionFieldPath final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; Value serialize(bool explain) const final; /* @@ -782,7 +782,7 @@ class ExpressionFilter final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -823,7 +823,7 @@ public: explicit ExpressionHour(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionHour, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -837,7 +837,7 @@ public: explicit ExpressionIfNull(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIfNull, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -847,7 +847,7 @@ public: explicit ExpressionIn(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIn, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -857,7 +857,7 @@ public: explicit ExpressionIndexOfArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfArray, 2, 4>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -867,7 +867,7 @@ public: explicit ExpressionIndexOfBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfBytes, 2, 4>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -880,7 +880,7 @@ public: explicit ExpressionIndexOfCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfCP, 2, 4>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -889,7 +889,7 @@ class ExpressionLet final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -931,7 +931,7 @@ public: explicit ExpressionLog(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionLog, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -948,7 +948,7 @@ class ExpressionMap final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -973,7 +973,7 @@ private: class ExpressionMeta final : public Expression { public: Value serialize(bool explain) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -997,7 +997,7 @@ public: explicit ExpressionMillisecond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMillisecond, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const long long date); @@ -1009,7 +1009,7 @@ public: explicit ExpressionMinute(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMinute, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const tm& tm) { @@ -1023,7 +1023,7 @@ public: explicit ExpressionMod(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMod, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1033,7 +1033,7 @@ public: explicit ExpressionMultiply(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionMultiply>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1051,7 +1051,7 @@ public: explicit ExpressionMonth(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMonth, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; // MySQL uses 1-12, tm uses 0-11 @@ -1066,7 +1066,7 @@ public: explicit ExpressionNot(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionNot, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1083,7 +1083,7 @@ class ExpressionObject final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; Value serialize(bool explain) const final; static boost::intrusive_ptr<ExpressionObject> create( @@ -1123,7 +1123,7 @@ public: : ExpressionVariadic<ExpressionOr>(expCtx) {} boost::intrusive_ptr<Expression> optimize() final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1144,7 +1144,7 @@ public: const boost::intrusive_ptr<ExpressionContext>& expCtx, Value base, Value exp); private: - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1154,7 +1154,7 @@ public: explicit ExpressionRange(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionRange, 2, 3>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1165,7 +1165,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, @@ -1188,7 +1188,7 @@ public: explicit ExpressionSecond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSecond, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -1202,7 +1202,7 @@ public: explicit ExpressionSetDifference(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSetDifference, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1212,7 +1212,7 @@ public: explicit ExpressionSetEquals(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetEquals>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; void validateArguments(const ExpressionVector& args) const final; }; @@ -1223,7 +1223,7 @@ public: explicit ExpressionSetIntersection(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetIntersection>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1243,7 +1243,7 @@ public: : ExpressionFixedArity<ExpressionSetIsSubset, 2>(expCtx) {} boost::intrusive_ptr<Expression> optimize() override; - Value evaluate(Document root) const override; + Value evaluate(const Document& root) const override; const char* getOpName() const final; private: @@ -1256,7 +1256,7 @@ public: explicit ExpressionSetUnion(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetUnion>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1274,7 +1274,7 @@ public: explicit ExpressionSize(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSize, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1284,7 +1284,7 @@ public: explicit ExpressionReverseArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionReverseArray, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1294,7 +1294,7 @@ public: explicit ExpressionSlice(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionSlice, 2, 3>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1304,7 +1304,7 @@ public: explicit ExpressionIsArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsArray, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1314,7 +1314,7 @@ public: explicit ExpressionSplit(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSplit, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1334,7 +1334,7 @@ public: explicit ExpressionStrcasecmp(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrcasecmp, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1344,7 +1344,7 @@ public: explicit ExpressionSubstrBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubstrBytes, 3>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const; }; @@ -1354,7 +1354,7 @@ public: explicit ExpressionSubstrCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubstrCP, 3>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1364,7 +1364,7 @@ public: explicit ExpressionStrLenBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrLenBytes, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1374,7 +1374,7 @@ public: explicit ExpressionStrLenCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrLenCP, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1384,7 +1384,7 @@ public: explicit ExpressionSubtract(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubtract, 2>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1395,7 +1395,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, @@ -1417,7 +1417,7 @@ public: explicit ExpressionToLower(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionToLower, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1427,7 +1427,7 @@ public: explicit ExpressionToUpper(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionToUpper, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1447,7 +1447,7 @@ public: explicit ExpressionType(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionType, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; }; @@ -1457,7 +1457,7 @@ public: explicit ExpressionWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionWeek, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1469,7 +1469,7 @@ public: explicit ExpressionIsoWeekYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoWeekYear, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1481,7 +1481,7 @@ public: explicit ExpressionIsoDayOfWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoDayOfWeek, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1493,7 +1493,7 @@ public: explicit ExpressionIsoWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoWeek, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1505,7 +1505,7 @@ public: explicit ExpressionYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionYear, 1>(expCtx) {} - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; const char* getOpName() const final; // tm_year is years since 1990 @@ -1521,7 +1521,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluate(Document root) const final; + Value evaluate(const Document& root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, |