Skip to content

Commit 6dc3cc0

Browse files
committed
DbRemoteDocumentCollectionIndexKey added
1 parent 02dfcdc commit 6dc3cc0

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/firestore/src/local/indexeddb_remote_document_cache.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ import { dbDocumentSize } from './indexeddb_mutation_batch_impl';
3939
import {
4040
DbRemoteDocument,
4141
DbRemoteDocumentType,
42-
DbRemoteDocumentGlobal
42+
DbRemoteDocumentGlobal,
43+
DbRemoteDocumentCollectionIndexKey
4344
} from './indexeddb_schema';
4445
import {
4546
DbRemoteDocumentCollectionGroupIndex,
@@ -289,7 +290,7 @@ class IndexedDbRemoteDocumentCacheImpl implements IndexedDbRemoteDocumentCache {
289290
context?: QueryContext
290291
): PersistencePromise<MutableDocumentMap> {
291292
const collection = query.path;
292-
const startKey = [
293+
const startKey: DbRemoteDocumentCollectionIndexKey = [
293294
DbRemoteDocumentType.FoundDocument,
294295
collection.popLast().toArray(),
295296
collection.lastSegment(),
@@ -298,7 +299,7 @@ class IndexedDbRemoteDocumentCacheImpl implements IndexedDbRemoteDocumentCache {
298299
? ''
299300
: offset.documentKey.path.lastSegment()
300301
];
301-
const endKey = [
302+
const endKey: DbRemoteDocumentCollectionIndexKey = [
302303
DbRemoteDocumentType.FoundDocument,
303304
collection.popLast().toArray(),
304305
collection.lastSegment(),

packages/firestore/src/local/indexeddb_schema.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ export interface DbRemoteDocument {
272272
documentType: DbRemoteDocumentType;
273273
}
274274

275+
/**
276+
* A key in the `DbRemoteDocumentCollectionIndex` index.
277+
*/
278+
export type DbRemoteDocumentCollectionIndexKey = [
279+
/** document type */ DbRemoteDocumentType,
280+
/** path to collection */ string[],
281+
/** collection group */ string,
282+
/** read time */ DbTimestampKey,
283+
/** document ID */ string
284+
];
285+
275286
/**
276287
* Contains a single entry that has metadata about the remote document cache.
277288
*/

0 commit comments

Comments
 (0)