FirebaseFirestore Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
FIRAggregateQuerySnapshot
@interface FIRAggregateQuerySnapshot : NSObject
The results of executing an AggregateQuery
.
-
The query that was executed to produce this result.
-
The number of documents in the result set of the underlying query.
Declaration
Objective-C
@property (nonatomic, readonly) NSNumber *_Nonnull count;
-
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
Objective-C
- (nonnull id)valueForAggregateField:
(nonnull FIRAggregateField *)aggregateField;
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,["# FirebaseFirestore Framework Reference\n\nFIRAggregateQuerySnapshot\n=========================\n\n\n @interface FIRAggregateQuerySnapshot : NSObject\n\nThe results of executing an `AggregateQuery`.\n- `\n ``\n ``\n `\n\n ### [query](#/c:objc(cs)FIRAggregateQuerySnapshot(py)query)\n\n `\n ` \n The query that was executed to produce this result. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic, readonly) ../Classes/FIRAggregateQuery.html *_Nonnull query;\n\n- `\n ``\n ``\n `\n\n ### [count](#/c:objc(cs)FIRAggregateQuerySnapshot(py)count)\n\n `\n ` \n The number of documents in the result set of the underlying query. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic, readonly) NSNumber *_Nonnull count;\n\n- `\n ``\n ``\n `\n\n ### [-valueForAggregateField:](#/c:objc(cs)FIRAggregateQuerySnapshot(im)valueForAggregateField:)\n\n `\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` 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`. \n See\n `AggregateField` \n\n #### Declaration\n\n Objective-C \n\n - (nonnull id)valueForAggregateField:\n (nonnull ../Classes/FIRAggregateField.html *)aggregateField;\n\n #### Parameters\n\n |------------------------|----------------------------------------------------------------------------------|\n | ` `*aggregateField*` ` | An instance of `AggregateField` that specifies which aggregate result to return. |\n\n #### Return Value\n\n Returns the aggregate result from the server without loss of precision."]]