Constructor
new AggregateQuery(query)
Build an AggregateQuery object.
Parameters:
Name |
Type |
Description |
query |
Query
|
|
- See:
-
Methods
addAggregation(aggregation) → {AggregateQuery}
Add a custom aggregation to the list of aggregations.
Parameters:
Returns:
addAggregations(aggregation) → {AggregateQuery}
Add a list of custom aggregations to the list of aggregations.
Parameters:
Returns:
average(property, alias) → {AggregateQuery}
Add a average
aggregate query to the list of aggregations.
Parameters:
Name |
Type |
Description |
property |
string
|
|
alias |
string
|
|
Returns:
Add a count
aggregate query to the list of aggregations.
Parameters:
Name |
Type |
Description |
alias |
string
|
|
Returns:
run(optionsOrCallbackopt, cb) → {void|Promise.<RunQueryResponse>}
Run the aggregation query and return the results.
Parameters:
Name |
Type |
Attributes |
Description |
optionsOrCallback |
RunQueryOptions
|
RequestCallback
|
<optional>
|
|
cb |
function
|
|
The callback function.
|
Returns:
Type |
Description |
void
|
Promise.<RunQueryResponse>
|
|
Add a sum
aggregate query to the list of aggregations.
Parameters:
Name |
Type |
Description |
property |
string
|
|
alias |
string
|
|
Returns:
toProto()
Get the proto for the list of aggregations.