File tree 6 files changed +10
-12
lines changed
6 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export class AggregateField<T> {
23
23
}
24
24
25
25
// @public
26
- export type AggregateFieldType = AggregateField <number > | AggregateField < number | null >;
26
+ export type AggregateFieldType = AggregateField <number | null >;
27
27
28
28
// @public
29
29
export class AggregateQuerySnapshot <T extends AggregateSpec > {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export class AggregateField<T> {
23
23
}
24
24
25
25
// @public
26
- export type AggregateFieldType = AggregateField <number > | AggregateField < number | null >;
26
+ export type AggregateFieldType = AggregateField <number | null >;
27
27
28
28
// @public
29
29
export class AggregateQuerySnapshot <T extends AggregateSpec > {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export function getCountFromServer(
71
71
*
72
72
* Using this function to perform aggregations is efficient because only the
73
73
* final aggregation values, not the documents' data, is downloaded. This
74
- * function can even perform aggregations if the documents if the result set
74
+ * function can even perform aggregations of the documents if the result set
75
75
* would be prohibitively large to download entirely (e.g. thousands of documents).
76
76
*
77
77
* The result received from the server is presented, unaltered, without
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export function getCount(
65
65
*
66
66
* Using this function to perform aggregations is efficient because only the
67
67
* final aggregation values, not the documents' data, is downloaded. This
68
- * function can even perform aggregations if the documents if the result set
68
+ * function can even perform aggregations of the documents if the result set
69
69
* would be prohibitively large to download entirely (e.g. thousands of documents).
70
70
*
71
71
* @param query The query whose result set to aggregate over.
@@ -172,9 +172,9 @@ export function aggregateFieldEqual(
172
172
return (
173
173
left instanceof AggregateField &&
174
174
right instanceof AggregateField &&
175
+ left . _aggregateType === right . _aggregateType &&
175
176
left . _internalFieldPath ?. canonicalString ( ) ===
176
- right . _internalFieldPath ?. canonicalString ( ) &&
177
- left . _aggregateType === right . _aggregateType
177
+ right . _internalFieldPath ?. canonicalString ( )
178
178
) ;
179
179
}
180
180
Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ export class AggregateField<T> {
45
45
) { }
46
46
}
47
47
48
+ // TODO (sum/avg) Update the definition of AggregateFieldType to be based
49
+ // on the return type of `sum(..)`, `average(...)`, and `count()`
48
50
/**
49
51
* The union of all `AggregateField` types that are supported by Firestore.
50
52
*/
51
- export type AggregateFieldType =
52
- | AggregateField < number >
53
- | AggregateField < number | null > ;
53
+ export type AggregateFieldType = AggregateField < number | null > ;
54
54
55
55
/**
56
56
* Specifies a set of aggregations and their aliases.
Original file line number Diff line number Diff line change @@ -263,9 +263,7 @@ export async function invokeRunAggregationQueryRpc(
263
263
const filteredResult = response . filter ( proto => ! ! proto . result ) ;
264
264
265
265
hardAssert (
266
- filteredResult . length === 1 &&
267
- filteredResult [ 0 ] . result !== undefined &&
268
- filteredResult [ 0 ] . result . aggregateFields !== undefined ,
266
+ filteredResult . length === 1 ,
269
267
'Aggregation fields are missing from result.'
270
268
) ;
271
269
You can’t perform that action at this time.
0 commit comments