summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression.h
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2017-09-12 11:46:56 -0400
committerJames Wahlin <james@mongodb.com>2017-09-27 14:29:57 -0400
commit790cd20518f4aeef78780293b15842c32e7e4b55 (patch)
tree4dc1cf971b9502ab005f2cc9aa1f048b631056e6 /src/mongo/db/pipeline/expression.h
parent7765cbafc5ab73262ce8d233c2410194b6bba1d7 (diff)
downloadmongo-790cd20518f4aeef78780293b15842c32e7e4b55.tar.gz
SERVER-30989 Expression to match rewrite module
Introduces a standalone Expression => MatchExpression rewrite module with unit tests.
Diffstat (limited to 'src/mongo/db/pipeline/expression.h')
-rw-r--r--src/mongo/db/pipeline/expression.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index 6532be87fb0..ed95bcdc2f1 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -268,6 +268,10 @@ public:
BSONElement bsonExpr,
const VariablesParseState& vps);
+ const ExpressionVector& getOperandList() const {
+ return vpOperand;
+ }
+
protected:
explicit ExpressionNary(const boost::intrusive_ptr<ExpressionContext>& expCtx)
: Expression(expCtx) {}
@@ -785,6 +789,10 @@ public:
Value evaluate(const Document& root) const final;
const char* getOpName() const final;
+ CmpOp getOp() const {
+ return cmpOp;
+ }
+
static boost::intrusive_ptr<Expression> parse(
const boost::intrusive_ptr<ExpressionContext>& expCtx,
BSONElement bsonExpr,
@@ -1032,6 +1040,10 @@ public:
class ExpressionFieldPath final : public Expression {
public:
+ bool isRootFieldPath() const {
+ return _variable == Variables::kRootId;
+ }
+
boost::intrusive_ptr<Expression> optimize() final;
Value evaluate(const Document& root) const final;
Value serialize(bool explain) const final;