devsite/tools/jazzy/templates

FirebaseFirestore Framework Reference

AggregateQuerySnapshot

class AggregateQuerySnapshot : NSObject, @unchecked Sendable

The results of executing an AggregateQuery.

  • The query that was executed to produce this result.

    Declaration

    Swift

    var query: FIRAggregateQuery { get }
  • The number of documents in the result set of the underlying query.

    Declaration

    Swift

    var count: NSNumber { get }
  • Gets the aggregate result for the specified aggregate field without loss of precision. No coercion of data types or values is performed.

    See the AggregateField class for the expected aggregate result values and types. Numeric aggregate results will be boxed in an NSNumber.

    Warning

    Throws an InvalidArgument exception if the aggregate field was not requested in the AggregateQuery.

    Declaration

    Swift

    func get(_ aggregateField: FIRAggregateField) -> Any

    Parameters

    aggregateField

    An instance of AggregateField that specifies which aggregate result to return.

    Return Value

    Returns the aggregate result from the server without loss of precision.