Represents an aggregation that can be performed by Firestore.
Package
@google-cloud/firestoreRemarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the AggregateField
class.
Properties
aggregateType
readonly
aggregateType
:
AggregateType
;
type
readonly
type
=
"AggregateField"
;
A type string to uniquely identify instances of this class.
Methods
average(field)
static
average
(
field
:
string
|
FieldPath
)
:
AggregateField<number
|
null
> ;
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.
field
count()
static
count
()
:
AggregateField<number>
;
Create an AggregateField object that can be used to compute the count of documents in the result set of a query.
isEqual(other)
isEqual
(
other
:
AggregateField<T>
)
:
boolean
;
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).
other
AggregateField
<T>
The object to compare to this object for equality. true
if this object is "equal" to the given object, as defined above, or false
otherwise.
boolean
sum(field)
static
sum
(
field
:
string
|
FieldPath
)
:
AggregateField<number>
;
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.
field