Skip to content
Snippets Groups Projects
Unverified Commit 781d7729 authored by Case Nelson's avatar Case Nelson Committed by GitHub
Browse files

[MLv2] Add remaining aggregation js wrappers (#31206)

parent 831b5329
Branches
Tags
No related merge requests found
......@@ -323,6 +323,30 @@
unit (if (string? unit) (keyword unit) unit)]
(lib.core/describe-relative-datetime n unit)))
(defn ^:export aggregate
"Adds an aggregation to query."
([a-query an-aggregate-clause]
(aggregate a-query -1 an-aggregate-clause))
([a-query stage-number an-aggregate-clause]
(lib.core/aggregate a-query stage-number an-aggregate-clause)))
(defn ^:export aggregations
"Get the aggregations in a given stage of a query."
([a-query]
(aggregations a-query -1))
([a-query stage-number]
(to-array (lib.core/aggregations a-query stage-number))))
(defn ^:export aggregation-clause
"Returns a standalone aggregation clause for an `aggregation-operator` and
a `column`.
For aggregations requiring an argument `column` is mandatory, otherwise
it is optional."
([aggregation-operator]
(lib.core/aggregation-clause aggregation-operator))
([aggregation-operator column]
(lib.core/aggregation-clause aggregation-operator column)))
(defn ^:export available-aggregation-operators
"Get the available aggregation operators for the stage with `stage-number` of
the query `a-query`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment