Skip to content

Commit c3675d4

Browse files
committed
fix comments
1 parent 79670bc commit c3675d4

File tree

7 files changed

+28
-22
lines changed

7 files changed

+28
-22
lines changed

.changeset/wicked-tomatoes-grow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@firebase/firestore': minor
33
---
44

5-
Expose getCountFromServer() and Lite SDK getCount()to enable Firestore count-only aggregate queries
5+
Added `getCountFromServer()` (`getCount()` in the Lite SDK), which fetches the number of documents in the result set without actually downloading the documents.

packages/firestore/lite/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export {
3131
aggregateQuerySnapshotEqual,
3232
getCount
3333
} from '../src/lite-api/aggregate';
34+
3435
export {
3536
AggregateField,
3637
AggregateFieldType,

packages/firestore/src/api.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@
1515
* limitations under the License.
1616
*/
1717

18+
export {
19+
aggregateQuerySnapshotEqual,
20+
getCountFromServer
21+
} from './api/aggregate';
22+
1823
export {
1924
AggregateField,
2025
AggregateFieldType,
2126
AggregateSpec,
2227
AggregateSpecData,
2328
AggregateQuerySnapshot,
24-
aggregateQuerySnapshotEqual,
25-
count,
26-
getCountFromServer
27-
} from './api/aggregate';
29+
count
30+
} from './lite-api/aggregate_types';
2831

2932
export { FieldPath, documentId } from './api/field_path';
3033

packages/firestore/src/api/aggregate.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,16 @@
1717

1818
import { Query } from '../api';
1919
import { firestoreClientRunCountQuery } from '../core/firestore_client';
20-
import { AggregateField, AggregateQuerySnapshot } from '../lite-api/aggregate_types';
20+
import {
21+
AggregateField,
22+
AggregateQuerySnapshot
23+
} from '../lite-api/aggregate_types';
2124
import { cast } from '../util/input_validation';
2225

2326
import { ensureFirestoreConfigured, Firestore } from './database';
2427
import { ExpUserDataWriter } from './reference_impl';
2528

26-
export {
27-
aggregateQuerySnapshotEqual
28-
} from '../lite-api/aggregate';
29-
export {
30-
AggregateField,
31-
AggregateFieldType,
32-
AggregateSpec,
33-
AggregateSpecData,
34-
AggregateQuerySnapshot,
35-
count
36-
} from '../lite-api/aggregate_types';
29+
export { aggregateQuerySnapshotEqual } from '../lite-api/aggregate';
3730

3831
/**
3932
* Executes the query and returns the results as a `AggregateQuerySnapshot` from the

packages/firestore/src/core/count_query_runner.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
*/
1717

1818
import { AbstractUserDataWriter, Query } from '../api';
19-
import { AggregateField, AggregateQuerySnapshot } from '../lite-api/aggregate_types';
19+
import {
20+
AggregateField,
21+
AggregateQuerySnapshot
22+
} from '../lite-api/aggregate_types';
2023
import { Value } from '../protos/firestore_proto_api';
2124
import { Datastore, invokeRunAggregationQueryRpc } from '../remote/datastore';
2225
import { hardAssert } from '../util/assert';
@@ -25,7 +28,7 @@ import { hardAssert } from '../util/assert';
2528
* CountQueryRunner encapsulates the logic needed to run the count aggregation
2629
* queries.
2730
*/
28-
export class CountQueryRunner<T> {
31+
export class CountQueryRunner {
2932
constructor(
3033
private readonly query: Query<unknown>,
3134
private readonly datastore: Datastore,

packages/firestore/src/core/firestore_client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
*/
1717

1818
import { GetOptions } from '@firebase/firestore-types';
19-
import { AbstractUserDataWriter } from '../api';
19+
2020
import {
21+
AbstractUserDataWriter,
2122
AggregateField,
2223
AggregateQuerySnapshot
23-
} from '../api/aggregate';
24+
} from '../api';
2425
import { LoadBundleTask } from '../api/bundle';
2526
import {
2627
CredentialChangeListener,

packages/firestore/src/lite-api/aggregate.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
*/
1717

1818
import { deepEqual } from '@firebase/util';
19+
1920
import { CountQueryRunner } from '../core/count_query_runner';
2021
import { cast } from '../util/input_validation';
2122

22-
import { AggregateField, AggregateQuerySnapshot, AggregateSpec } from './aggregate_types';
23+
import {
24+
AggregateField,
25+
AggregateQuerySnapshot,
26+
AggregateSpec
27+
} from './aggregate_types';
2328
import { getDatastore } from './components';
2429
import { Firestore } from './database';
2530
import { Query, queryEqual } from './reference';

0 commit comments

Comments
 (0)