summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression.h
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@mongodb.com>2019-09-10 22:58:06 +0000
committerevergreen <evergreen@mongodb.com>2019-09-10 22:58:06 +0000
commitec7207615f975d04392ea7cb3fba4d6d0cfe1a6c (patch)
tree6afa6ab6d4f3c55c77ab6eea6ab504f146a2ab30 /src/mongo/db/pipeline/expression.h
parent42f6c0aeb341b1b0d2b6bbcea15acf35086a038c (diff)
downloadmongo-ec7207615f975d04392ea7cb3fba4d6d0cfe1a6c.tar.gz
SERVER-43013 Translate Map Reduce to Agg Pipeline
Diffstat (limited to 'src/mongo/db/pipeline/expression.h')
-rw-r--r--src/mongo/db/pipeline/expression.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index 8c8bbc54ae9..85872dc675b 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -822,8 +822,21 @@ public:
explicit ExpressionArray(const boost::intrusive_ptr<ExpressionContext>& expCtx)
: ExpressionVariadic<ExpressionArray>(expCtx) {}
+ ExpressionArray(const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ std::vector<boost::intrusive_ptr<Expression>>&& children)
+ : ExpressionVariadic<ExpressionArray>(expCtx) {
+ _children = std::move(children);
+ }
+
Value evaluate(const Document& root, Variables* variables) const final;
Value serialize(bool explain) const final;
+
+ static boost::intrusive_ptr<ExpressionArray> create(
+ const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ std::vector<boost::intrusive_ptr<Expression>>&& children) {
+ return make_intrusive<ExpressionArray>(expCtx, std::move(children));
+ }
+
boost::intrusive_ptr<Expression> optimize() final;
const char* getOpName() const final;
@@ -1788,8 +1801,8 @@ public:
static boost::intrusive_ptr<ExpressionObject> create(
const boost::intrusive_ptr<ExpressionContext>& expCtx,
- std::vector<boost::intrusive_ptr<Expression>> children,
- std::vector<std::pair<std::string, boost::intrusive_ptr<Expression>&>>&& expressions);
+ std::vector<std::pair<std::string, boost::intrusive_ptr<Expression>>>&&
+ expressionsWithChildrenInPlace);
/**
* Parses and constructs an ExpressionObject from 'obj'.