Constructor
new AggregateField(aggregateType, field)
Create a new AggregateField
Parameters:
Name | Type | Description |
---|---|---|
aggregateType |
Specifies the type of aggregation operation to perform. |
|
field |
Optionally specifies the field that is aggregated. |
Members
type
A type string to uniquely identify instances of this class.
Methods
isEqual(other)
Compares this object with the given object for equality.
This object is considered "equal" to the other object if and only if
other
performs the same kind of aggregation on the same field (if any).
Parameters:
Name | Type | Description |
---|---|---|
other |
The object to compare to this object for equality. |
Returns:
Type | Description |
---|---|
|
(static) average(field)
Create an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query.
Parameters:
Name | Type | Description |
---|---|---|
field |
Specifies the field to average across the result set. |
(static) count()
Create an AggregateField object that can be used to compute the count of documents in the result set of a query.
(static) sum(field)
Create an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query.
Parameters:
Name | Type | Description |
---|---|---|
field |
Specifies the field to sum across the result set. |