diff options
author | Raunak Chowdhury <raunak.chowdhury@mongodb.com> | 2021-08-19 15:06:30 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-08-19 19:22:08 +0000 |
commit | 25b38953eaaf8f38bbe579220c21e7738a5c0c31 (patch) | |
tree | fc5fb58380326a544918982af25772f8fd504780 /src/mongo/db/pipeline/window_function | |
parent | 4606e0e74e5e21dbdef0f74f16fccd1f1301299c (diff) | |
download | mongo-25b38953eaaf8f38bbe579220c21e7738a5c0c31.tar.gz |
SERVER-57878 Implement $firstN and $lastN accumulators
Diffstat (limited to 'src/mongo/db/pipeline/window_function')
-rw-r--r-- | src/mongo/db/pipeline/window_function/window_function_expression.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/window_function/window_function_expression.h b/src/mongo/db/pipeline/window_function/window_function_expression.h index 17f05a1030d..e1b2d17a338 100644 --- a/src/mongo/db/pipeline/window_function/window_function_expression.h +++ b/src/mongo/db/pipeline/window_function/window_function_expression.h @@ -32,6 +32,7 @@ #include "mongo/base/initializer.h" #include "mongo/db/pipeline/accumulator.h" #include "mongo/db/pipeline/accumulator_for_window_functions.h" +#include "mongo/db/pipeline/accumulator_multi.h" #include "mongo/db/pipeline/document_source.h" #include "mongo/db/pipeline/document_source_set_window_fields_gen.h" #include "mongo/db/pipeline/window_function/window_bounds.h" @@ -657,10 +658,7 @@ public: class ExpressionFirstLast : public Expression { public: - enum Sense : int { - kFirst, - kLast, - }; + using Sense = AccumulatorFirstLastN::Sense; static boost::intrusive_ptr<Expression> parse(BSONObj obj, const boost::optional<SortPattern>& sortBy, |