Firestore API - Class AggregateQuerySnapshot (3.5.0)

public sealed class AggregateQuerySnapshot : IEquatable<AggregateQuerySnapshot>

Reference documentation and code samples for the Firestore API class AggregateQuerySnapshot.

An immutable snapshot of aggregate query results.

Inheritance

object > AggregateQuerySnapshot

Namespace

Google.Cloud.Firestore

Assembly

Google.Cloud.Firestore.dll

Properties

Count

public long? Count { get; }

Number of documents that matches the query. May be null when count aggregation is not applied on the Query. Note that when the query contains a limit, the count is restricted by that limit.

Property Value
TypeDescription
long

Query

public AggregateQuery Query { get; }

The query producing this snapshot.

Property Value
TypeDescription
AggregateQuery

ReadTime

public Timestamp ReadTime { get; }

The time at which the snapshot was read.

Property Value
TypeDescription
Timestamp

Methods

GetHashCode()

public override int GetHashCode()

Serves as the default hash function.

Returns
TypeDescription
int

A hash code for the current object.

Overrides

GetValue<T>(AggregateField)

public T GetValue<T>(AggregateField aggregateField)

Fetches the value from the dictionary, throwing an exception if the value does not exist.

Parameter
NameDescription
aggregateFieldAggregateField

The aggregate field to fetch. Must not be null.

Returns
TypeDescription
T

The deserialized value.

Type Parameter
NameDescription
T
Exceptions
TypeDescription
InvalidOperationException

The field does not exist in the dictionary.

GetValue<T>(string)

public T GetValue<T>(string alias)

Fetches the value from the dictionary, throwing an exception if the value does not exist.

Parameter
NameDescription
aliasstring

The parameter to match the alias of aggregation result to be fetched. Must not be null.

Returns
TypeDescription
T

The deserialized value.

Type Parameter
NameDescription
T
Exceptions
TypeDescription
InvalidOperationException

The field does not exist in the dictionary.