AggregateField
public abstract class AggregateField
AggregateField.AverageAggregateField |
Represents an "average" aggregation that can be performed by Firestore. |
AggregateField.CountAggregateField |
Represents a "count" aggregation that can be performed by Firestore. |
AggregateField.SumAggregateField |
Represents a "sum" aggregation that can be performed by Firestore. |
Represents an aggregation that can be performed by Firestore.
Summary
Nested types |
|---|
public class AggregateField.AverageAggregateField extends AggregateFieldRepresents an "average" aggregation that can be performed by Firestore. |
public class AggregateField.CountAggregateField extends AggregateFieldRepresents a "count" aggregation that can be performed by Firestore. |
public class AggregateField.SumAggregateField extends AggregateFieldRepresents a "sum" aggregation that can be performed by Firestore. |
Public methods |
|
|---|---|
static @NonNull AggregateField.AverageAggregateField |
Create an |
static @NonNull AggregateField.AverageAggregateField |
Create an |
static @NonNull AggregateField.CountAggregateField |
count()Create a |
boolean |
Returns true if the given object is equal to this object. |
int |
hashCode()Calculates and returns the hash code for this object. |
static @NonNull AggregateField.SumAggregateField |
Create a |
static @NonNull AggregateField.SumAggregateField |
Create a |
Public fields
Public methods
average
public static @NonNull AggregateField.AverageAggregateField average(@NonNull String field)
Create an AverageAggregateField 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.
The result of an average operation will always be a double or NaN.
- Averaging over zero documents or fields will result in a double value representing NaN.
- Averaging over NaN will result in a double value representing NaN.
| Returns | |
|---|---|
@NonNull AggregateField.AverageAggregateField |
The `AverageAggregateField` 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. |
average
public static @NonNull AggregateField.AverageAggregateField average(@NonNull FieldPath fieldPath)
Create an AverageAggregateField 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.
The result of an average operation will always be a double or NaN.
- Averaging over zero documents or fields will result in a double value representing NaN.
- Averaging over NaN will result in a double value representing NaN.
| Returns | |
|---|---|
@NonNull AggregateField.AverageAggregateField |
The `AverageAggregateField` 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. |
count
public static @NonNull AggregateField.CountAggregateField count()
Create a CountAggregateField object that can be used to compute the count of documents in the result set of a query.
The result of a count operation will always be a 64-bit integer value.
| Returns | |
|---|---|
@NonNull AggregateField.CountAggregateField |
The `CountAggregateField` object that can be used to compute the count of documents in the result set of a query. |
equals
public boolean equals(Object other)
Returns true if the given object is equal to this object. Two `AggregateField` objects are considered equal if they have the same operator and operate on the same field.
sum
public static @NonNull AggregateField.SumAggregateField sum(@NonNull String field)
Create a SumAggregateField 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.
The result of a sum operation will always be a 64-bit integer value, a double, or NaN.
- Summing over zero documents or fields will result in 0L.
- Summing over NaN will result in a double value representing NaN.
- A sum that overflows the maximum representable 64-bit integer value will result in a double return value. This may result in lost precision of the result.
- A sum that overflows the maximum representable double value will result in a double return value representing infinity.
| Returns | |
|---|---|
@NonNull AggregateField.SumAggregateField |
The `SumAggregateField` 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. |
sum
public static @NonNull AggregateField.SumAggregateField sum(@NonNull FieldPath fieldPath)
Create a SumAggregateField 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.
The result of a sum operation will always be a 64-bit integer value, a double, or NaN.
- Summing over zero documents or fields will result in 0L.
- Summing over NaN will result in a double value representing NaN.
- A sum that overflows the maximum representable 64-bit integer value will result in a double return value. This may result in lost precision of the result.
- A sum that overflows the maximum representable double value will result in a double return value representing infinity.
| Returns | |
|---|---|
@NonNull AggregateField.SumAggregateField |
The `SumAggregateField` 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. |