diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2019-10-14 20:58:20 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-14 20:58:20 +0000 |
commit | 2fb44f082935fcefdce1fcb94e0cef2aab6e945e (patch) | |
tree | d842d9241998e704ac05c15b4c7a1f39408cfbc1 /src/mongo/db/commands/mr_common.cpp | |
parent | c119ef45e3f1c2cc7f36c7b81d0731e332461c2b (diff) | |
download | mongo-2fb44f082935fcefdce1fcb94e0cef2aab6e945e.tar.gz |
SERVER-43796 Support accumulators with an additional static argument
Diffstat (limited to 'src/mongo/db/commands/mr_common.cpp')
-rw-r--r-- | src/mongo/db/commands/mr_common.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/commands/mr_common.cpp b/src/mongo/db/commands/mr_common.cpp index ea0dea5e218..1f2e0093919 100644 --- a/src/mongo/db/commands/mr_common.cpp +++ b/src/mongo/db/commands/mr_common.cpp @@ -93,10 +93,9 @@ auto translateReduce(boost::intrusive_ptr<ExpressionContext> expCtx, std::string std::pair{"data"s, ExpressionFieldPath::parse(expCtx, "$emits", expCtx->variablesParseState)}, std::pair{"eval"s, ExpressionConstant::create(expCtx, Value{code})})); - auto jsReduce = AccumulationStatement{ - "value", - std::move(accumulatorArguments), - AccumulationStatement::getFactory(AccumulatorInternalJsReduce::kAccumulatorName)}; + auto jsReduce = AccumulationStatement{"value", std::move(accumulatorArguments), [expCtx]() { + return AccumulatorInternalJsReduce::create(expCtx); + }}; auto groupExpr = ExpressionFieldPath::parse(expCtx, "$emits.k", expCtx->variablesParseState); return DocumentSourceGroup::create(expCtx, std::move(groupExpr), |