FirebaseFirestore Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.
[null,null,["Last updated 2025-03-11 UTC."],[],[],null,["AggregateQuerySnapshot \n\n class AggregateQuerySnapshot : NSObject, @unchecked Sendable\n\nThe results of executing an [AggregateQuery](../Classes/AggregateQuery.html).\n- `\n ``\n ``\n `\n\n [query](#/c:objc(cs)FIRAggregateQuerySnapshot(py)query)`\n ` \n The query that was executed to produce this result. \n\n Declaration \n Swift \n\n var query: FIRAggregateQuery { get }\n\n- `\n ``\n ``\n `\n\n [count](#/c:objc(cs)FIRAggregateQuerySnapshot(py)count)`\n ` \n The number of documents in the result set of the underlying query. \n\n Declaration \n Swift \n\n var count: NSNumber { get }\n\n- `\n ``\n ``\n `\n\n [get(_:)](#/c:objc(cs)FIRAggregateQuerySnapshot(im)valueForAggregateField:)`\n ` \n Gets the aggregate result for the specified aggregate field without loss of precision. No\n coercion of data types or values is performed.\n\n See the [AggregateField](../Classes/AggregateField.html) class for the expected aggregate result values and types. Numeric\n aggregate results will be boxed in an `NSNumber`. \n Warning\n Throws an `InvalidArgument` exception if the aggregate field was not requested in the [AggregateQuery](../Classes/AggregateQuery.html). \n See\n [AggregateField](../Classes/AggregateField.html) \n\n Declaration \n Swift \n\n func get(_ aggregateField: FIRAggregateField) -\u003e Any\n\n Parameters\n\n Return Value\n\n Returns the aggregate result from the server without loss of precision."]]