summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorKarmen Liang <karmen.liang@mongodb.com>2020-07-29 16:51:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-30 20:26:02 +0000
commit921b1e1cce5fdcafe530b48d9427c699103678e4 (patch)
tree81629383f257e2e2d1fcc070d1ea6a6b86c292a6 /src/mongo/db/pipeline
parent3012da79e0b640bf2429f2b83a59ef1ba60271cc (diff)
downloadmongo-921b1e1cce5fdcafe530b48d9427c699103678e4.tar.gz
SERVER-48874 Implement agg type expressions in grammar and CST
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/expression.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index c718cbd5579..862a6a31da6 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -2525,6 +2525,9 @@ public:
explicit ExpressionType(ExpressionContext* const expCtx)
: ExpressionFixedArity<ExpressionType, 1>(expCtx) {}
+ ExpressionType(ExpressionContext* const expCtx, ExpressionVector&& children)
+ : ExpressionFixedArity<ExpressionType, 1>(expCtx, std::move(children)) {}
+
Value evaluate(const Document& root, Variables* variables) const final;
const char* getOpName() const final;
@@ -2671,6 +2674,11 @@ private:
class ExpressionConvert final : public Expression {
public:
+ ExpressionConvert(ExpressionContext* const expCtx,
+ boost::intrusive_ptr<Expression> input,
+ boost::intrusive_ptr<Expression> to,
+ boost::intrusive_ptr<Expression> onError,
+ boost::intrusive_ptr<Expression> onNull);
/**
* Creates a $convert expression converting from 'input' to the type given by 'toType'. Leaves
* 'onNull' and 'onError' unspecified.
@@ -2695,12 +2703,6 @@ protected:
void _doAddDependencies(DepsTracker* deps) const final;
private:
- ExpressionConvert(ExpressionContext* const,
- boost::intrusive_ptr<Expression> input,
- boost::intrusive_ptr<Expression> to,
- boost::intrusive_ptr<Expression> onError,
- boost::intrusive_ptr<Expression> onNull);
-
BSONType computeTargetType(Value typeName) const;
Value performConversion(BSONType targetType, Value inputValue) const;