summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/accumulator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/accumulator.cpp')
-rw-r--r--src/mongo/db/pipeline/accumulator.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/mongo/db/pipeline/accumulator.cpp b/src/mongo/db/pipeline/accumulator.cpp
index 13f21da064c..db6024664a4 100644
--- a/src/mongo/db/pipeline/accumulator.cpp
+++ b/src/mongo/db/pipeline/accumulator.cpp
@@ -25,25 +25,8 @@
namespace mongo {
using namespace mongoutils;
- void Accumulator::addOperand(
- const intrusive_ptr<Expression> &pExpression) {
- uassert(15943, str::stream() << "group accumulator " <<
- getOpName() << " only accepts one operand",
- vpOperand.size() < 1);
-
- ExpressionNary::addOperand(pExpression);
- }
-
- Accumulator::Accumulator():
- ExpressionNary() {
- }
-
Value Accumulator::serialize() const {
- verify(vpOperand.size() == 1);
-
- MutableDocument valBuilder;
- valBuilder[getOpName()] = vpOperand[0]->serialize();
- return valBuilder.freezeToValue();
+ return Value(DOC(getOpName() << _expr->serialize()));
}
void agg_framework_reservedErrors() {