Skip to content

Commit 95d6b1a

Browse files
committed
Change log and feedback.
1 parent b93862a commit 95d6b1a

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

Firestore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Unreleased
2+
- [feature] Added `Query.count()`, which fetches the number of documents in the
3+
result set without actually downloading the documents (#10246).
24
- [fixed] Fixed compiler warning about `@param comparator` (#10226).
35

46
# 9.6.0

Firestore/Source/Public/FirebaseFirestore/FIRAggregateQuery.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
#import <Foundation/Foundation.h>
18+
1719
#import "FIRAggregateSource.h"
1820

21+
NS_ASSUME_NONNULL_BEGIN
22+
1923
@class FIRQuery;
2024
@class FIRAggregateQuerySnapshot;
2125

@@ -27,7 +31,7 @@ NS_SWIFT_NAME(AggregateQuery)
2731
@interface FIRAggregateQuery : NSObject
2832

2933
/** The base `Query` for this aggregate query. */
30-
@property(nonatomic, readonly) FIRQuery *_Nonnull query;
34+
@property(nonatomic, readonly) FIRQuery *query;
3135

3236
/**
3337
* Executes the aggregate query and reads back the results as a `FIRAggregateQuerySnapshot`.
@@ -37,7 +41,9 @@ NS_SWIFT_NAME(AggregateQuery)
3741
* snapshot will be `nil` only if error is `non-nil`.
3842
*/
3943
- (void)aggregationWithSource:(FIRAggregateSource)source
40-
completion:(void (^_Nonnull)(FIRAggregateQuerySnapshot *_Nullable snapshot,
41-
NSError *_Nullable error))completion
42-
NS_SWIFT_NAME(aggregation(source:completion:));
44+
completion:(void (^)(FIRAggregateQuerySnapshot *_Nullable snapshot,
45+
NSError *_Nullable error))completion
46+
NS_SWIFT_NAME(getAggregation(source:completion:));
4347
@end
48+
49+
NS_ASSUME_NONNULL_END

Firestore/Source/Public/FirebaseFirestore/FIRAggregateQuerySnapshot.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import <Foundation/Foundation.h>
1818

19+
NS_ASSUME_NONNULL_BEGIN
20+
1921
@class FIRAggregateQuery;
2022

2123
/**
@@ -25,12 +27,14 @@ NS_SWIFT_NAME(AggregateQuerySnapshot)
2527
@interface FIRAggregateQuerySnapshot : NSObject
2628

2729
/** The original `AggregateQuery` this snapshot is a result of. */
28-
@property(nonatomic, readonly) FIRAggregateQuery* _Nonnull query;
30+
@property(nonatomic, readonly) FIRAggregateQuery* query;
2931

3032
/**
3133
* The result of a document count aggregation. Null if no count aggregation is
3234
* available in the result.
3335
*/
34-
@property(nonatomic, readonly) NSNumber* _Nullable count;
36+
@property(nonatomic, readonly) NSNumber* count;
3537

3638
@end
39+
40+
NS_ASSUME_NONNULL_END

Firestore/Source/Public/FirebaseFirestore/FIRAggregateSource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import <Foundation/Foundation.h>
1818

19+
NS_ASSUME_NONNULL_BEGIN
20+
1921
/** Configures the behavior of `AggregateQuery.aggregateWithSource(source:completion:)`. */
2022
typedef NS_ENUM(NSUInteger, FIRAggregateSource) {
2123
/**
@@ -26,3 +28,5 @@ typedef NS_ENUM(NSUInteger, FIRAggregateSource) {
2628
*/
2729
FIRAggregateSourceServer,
2830
} NS_SWIFT_NAME(AggregateSource);
31+
32+
NS_ASSUME_NONNULL_END

Firestore/Swift/Tests/Integration/AsyncAwaitIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let emptyBundle = """
7777
func testCount() async throws {
7878
let collection = collectionRef()
7979
try await collection.addDocument(data: [:])
80-
let snapshot = try await collection.count.aggregation(source: .server)
80+
let snapshot = try await collection.count.getAggregation(source: .server)
8181
XCTAssertEqual(snapshot.count, 1)
8282
}
8383
}

0 commit comments

Comments
 (0)