@firebase/firestore 3.4.13 → 3.4.14-20220804201204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/firestore/src/api/index_configuration.d.ts +2 -8
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/firestore/src/util/array.d.ts +18 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/index.d.ts +91 -1
- package/dist/index.esm2017.js +2525 -2387
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +2383 -2282
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +216 -37
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +216 -37
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2448 -2311
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +5 -13
- package/dist/lite/firestore/src/api/index_configuration.d.ts +2 -8
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/lite/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/lite/firestore/src/util/array.d.ts +18 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/lite/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/lite/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +2 -8
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/lite/packages/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/lite/packages/firestore/src/util/array.d.ts +18 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/lite/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/lite/packages/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/packages/firestore/dist/index.esm2017.d.ts +150 -150
- package/dist/packages/firestore/src/api/index_configuration.d.ts +2 -8
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/packages/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/packages/firestore/src/util/array.d.ts +18 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/packages/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/private.d.ts +92 -4
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @firebase/firestore
|
|
2
2
|
|
|
3
|
+
## 3.4.14-20220804201204
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f5426a512`](https://github.com/firebase/firebase-js-sdk/commit/f5426a51275bb611a5d9a6df3200d0fe5095afa2) [#6403](https://github.com/firebase/firebase-js-sdk/pull/6403) - Add internal implementation of setIndexConfiguration
|
|
8
|
+
|
|
9
|
+
* [`10765511f`](https://github.com/firebase/firebase-js-sdk/commit/10765511f7ba33293f7a15af1f98d69a261c019d) [#6496](https://github.com/firebase/firebase-js-sdk/pull/6496) - Expose client side indexing feature with `setIndexConfiguration`.
|
|
10
|
+
|
|
11
|
+
* Updated dependencies [[`82a6add13`](https://github.com/firebase/firebase-js-sdk/commit/82a6add1354fe7e4ac1d444157ac027cdd41da6e)]:
|
|
12
|
+
- @firebase/app@0.7.30-20220804201204
|
|
13
|
+
|
|
3
14
|
## 3.4.13
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { FieldIndex } from '../model/field_index';
|
|
17
18
|
import { Firestore } from './database';
|
|
18
19
|
export { connectFirestoreEmulator, EmulatorMockTokenOptions } from '../lite-api/database';
|
|
19
20
|
/**
|
|
20
21
|
* A single field element in an index configuration.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
22
|
*/
|
|
24
23
|
export interface IndexField {
|
|
25
24
|
/** The field path to index. */
|
|
@@ -42,8 +41,6 @@ export interface IndexField {
|
|
|
42
41
|
}
|
|
43
42
|
/**
|
|
44
43
|
* The SDK definition of a Firestore index.
|
|
45
|
-
*
|
|
46
|
-
* @internal
|
|
47
44
|
*/
|
|
48
45
|
export interface Index {
|
|
49
46
|
/** The ID of the collection to index. */
|
|
@@ -57,8 +54,6 @@ export interface Index {
|
|
|
57
54
|
*
|
|
58
55
|
* See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
|
|
59
56
|
* for a description of the format of the index definition.
|
|
60
|
-
*
|
|
61
|
-
* @internal
|
|
62
57
|
*/
|
|
63
58
|
export interface IndexConfiguration {
|
|
64
59
|
/** A list of all Firestore indexes. */
|
|
@@ -80,7 +75,6 @@ export interface IndexConfiguration {
|
|
|
80
75
|
* before setting an index configuration. If IndexedDb is not enabled, any
|
|
81
76
|
* index configuration is ignored.
|
|
82
77
|
*
|
|
83
|
-
* @internal
|
|
84
78
|
* @param firestore - The {@link Firestore} instance to configure indexes for.
|
|
85
79
|
* @param configuration -The index definition.
|
|
86
80
|
* @throws FirestoreError if the JSON format is invalid.
|
|
@@ -107,7 +101,6 @@ export declare function setIndexConfiguration(firestore: Firestore, configuratio
|
|
|
107
101
|
* firestore:indexes`). If the JSON format is invalid, this method throws an
|
|
108
102
|
* error.
|
|
109
103
|
*
|
|
110
|
-
* @internal
|
|
111
104
|
* @param firestore - The {@link Firestore} instance to configure indexes for.
|
|
112
105
|
* @param json -The JSON format exported by the Firebase CLI.
|
|
113
106
|
* @throws FirestoreError if the JSON format is invalid.
|
|
@@ -115,3 +108,4 @@ export declare function setIndexConfiguration(firestore: Firestore, configuratio
|
|
|
115
108
|
* configured.
|
|
116
109
|
*/
|
|
117
110
|
export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
|
|
111
|
+
export declare function parseIndexes(jsonOrConfiguration: string | IndexConfiguration): FieldIndex[];
|
|
@@ -36,6 +36,7 @@ export { CACHE_SIZE_UNLIMITED } from './api/database';
|
|
|
36
36
|
export { FirestoreErrorCode, FirestoreError } from './util/error';
|
|
37
37
|
export { AbstractUserDataWriter } from './lite-api/user_data_writer';
|
|
38
38
|
export { Primitive, NestedUpdateFields, ChildUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
|
|
39
|
+
export { setIndexConfiguration, Index, IndexConfiguration, IndexField } from './api/index_configuration';
|
|
39
40
|
/**
|
|
40
41
|
* Internal exports
|
|
41
42
|
*/
|
|
@@ -50,4 +51,3 @@ export type { ByteString as _ByteString } from './util/byte_string';
|
|
|
50
51
|
export { logWarn as _logWarn } from './util/log';
|
|
51
52
|
export { EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider } from './api/credentials';
|
|
52
53
|
export { EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider } from './api/credentials';
|
|
53
|
-
export { setIndexConfiguration as _setIndexConfiguration } from './api/index_configuration';
|
|
@@ -20,8 +20,6 @@ import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
|
20
20
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
21
21
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
22
22
|
import { DbTimestampKey } from './indexeddb_sentinels';
|
|
23
|
-
export declare const INDEXING_ENABLED = false;
|
|
24
|
-
export declare const INDEXING_SCHEMA_VERSION = 15;
|
|
25
23
|
/**
|
|
26
24
|
* Schema Version for the Web client:
|
|
27
25
|
* 1. Initial version including Mutation Queue, Query Cache, and Remote
|
|
@@ -46,7 +44,7 @@ export declare const INDEXING_SCHEMA_VERSION = 15;
|
|
|
46
44
|
* 14. Add overlays.
|
|
47
45
|
* 15. Add indexing support.
|
|
48
46
|
*/
|
|
49
|
-
export declare const SCHEMA_VERSION
|
|
47
|
+
export declare const SCHEMA_VERSION = 15;
|
|
50
48
|
/**
|
|
51
49
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
52
50
|
*/
|
|
@@ -23,6 +23,7 @@ import { BatchId, TargetId } from '../core/types';
|
|
|
23
23
|
import { DocumentKeySet, DocumentMap } from '../model/collections';
|
|
24
24
|
import { Document } from '../model/document';
|
|
25
25
|
import { DocumentKey } from '../model/document_key';
|
|
26
|
+
import { FieldIndex } from '../model/field_index';
|
|
26
27
|
import { Mutation } from '../model/mutation';
|
|
27
28
|
import { MutationBatch, MutationBatchResult } from '../model/mutation_batch';
|
|
28
29
|
import { BundleMetadata, NamedQuery as ProtoNamedQuery } from '../protos/firestore_bundle_proto';
|
|
@@ -192,3 +193,4 @@ export declare function localStoreGetNamedQuery(localStore: LocalStore, queryNam
|
|
|
192
193
|
* Saves the given `NamedQuery` to local persistence.
|
|
193
194
|
*/
|
|
194
195
|
export declare function localStoreSaveNamedQuery(localStore: LocalStore, query: ProtoNamedQuery, documents?: DocumentKeySet): Promise<void>;
|
|
196
|
+
export declare function localStoreConfigureFieldIndexes(localStore: LocalStore, newFieldIndexes: FieldIndex[]): Promise<void>;
|
|
@@ -28,3 +28,21 @@ export declare function some<T>(array: T[], predicate: (t: T) => boolean): boole
|
|
|
28
28
|
* predicate does not return true for any item, null is returned.
|
|
29
29
|
*/
|
|
30
30
|
export declare function findIndex<A>(array: A[], predicate: (value: A) => boolean): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* Compares two array for equality using comparator. The method computes the
|
|
33
|
+
* intersection and invokes `onAdd` for every element that is in `after` but not
|
|
34
|
+
* `before`. `onRemove` is invoked for every element in `before` but missing
|
|
35
|
+
* from `after`.
|
|
36
|
+
*
|
|
37
|
+
* The method creates a copy of both `before` and `after` and runs in O(n log
|
|
38
|
+
* n), where n is the size of the two lists.
|
|
39
|
+
*
|
|
40
|
+
* @param before - The elements that exist in the original array.
|
|
41
|
+
* @param after - The elements to diff against the original array.
|
|
42
|
+
* @param comparator - The comparator for the elements in before and after.
|
|
43
|
+
* @param onAdd - A function to invoke for every element that is part of `
|
|
44
|
+
* after` but not `before`.
|
|
45
|
+
* @param onRemove - A function to invoke for every element that is part of
|
|
46
|
+
* `before` but not `after`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function diffArrays<T>(before: T[], after: T[], comparator: (l: T, r: T) => number, onAdd: (entry: T) => void, onRemove: (entry: T) => void): void;
|
|
@@ -50,9 +50,20 @@ export declare class CountingQueryEngine extends QueryEngine {
|
|
|
50
50
|
* and `getEntries()` APIs (since the last call to `resetCounts()`)
|
|
51
51
|
*/
|
|
52
52
|
documentsReadByKey: number;
|
|
53
|
+
/**
|
|
54
|
+
* The number of documents returned by the OverlayCache's `getOverlays()`
|
|
55
|
+
* API (since the last call to `resetCounts()`)
|
|
56
|
+
*/
|
|
57
|
+
overlaysReadByCollection: number;
|
|
58
|
+
/**
|
|
59
|
+
* The number of documents returned by the OverlayCache's `getOverlay()`
|
|
60
|
+
* APIs (since the last call to `resetCounts()`)
|
|
61
|
+
*/
|
|
62
|
+
overlaysReadByKey: number;
|
|
53
63
|
resetCounts(): void;
|
|
54
64
|
getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, lastLimboFreeSnapshotVersion: SnapshotVersion, remoteKeys: DocumentKeySet): PersistencePromise<DocumentMap>;
|
|
55
65
|
initialize(localDocuments: LocalDocumentsView, indexManager: IndexManager): void;
|
|
56
66
|
private wrapRemoteDocumentCache;
|
|
57
67
|
private wrapMutationQueue;
|
|
68
|
+
private wrapDocumentOverlayCache;
|
|
58
69
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { IndexConfiguration } from '../../../src/api/index_configuration';
|
|
17
18
|
import { Query } from '../../../src/core/query';
|
|
18
19
|
import { Target } from '../../../src/core/target';
|
|
19
20
|
import { TargetIdGenerator } from '../../../src/core/target_id_generator';
|
|
20
21
|
import { TargetId } from '../../../src/core/types';
|
|
21
22
|
import { Document } from '../../../src/model/document';
|
|
22
23
|
import { DocumentKey } from '../../../src/model/document_key';
|
|
24
|
+
import { FieldIndex } from '../../../src/model/field_index';
|
|
23
25
|
import { JsonObject } from '../../../src/model/object_value';
|
|
24
26
|
import { TimerId } from '../../../src/util/async_queue';
|
|
25
27
|
import { Code } from '../../../src/util/error';
|
|
@@ -113,6 +115,7 @@ export declare class SpecBuilder {
|
|
|
113
115
|
userAddsSnapshotsInSyncListener(): this;
|
|
114
116
|
userRemovesSnapshotsInSyncListener(): this;
|
|
115
117
|
loadBundle(bundleContent: string): this;
|
|
118
|
+
setIndexConfiguration(jsonOrConfiguration: string | IndexConfiguration): this;
|
|
116
119
|
becomeHidden(): this;
|
|
117
120
|
becomeVisible(): this;
|
|
118
121
|
runTimer(timerId: TimerId): this;
|
|
@@ -130,6 +133,8 @@ export declare class SpecBuilder {
|
|
|
130
133
|
/** Stops failing database operations. */
|
|
131
134
|
recoverDatabase(): this;
|
|
132
135
|
expectIsShutdown(): this;
|
|
136
|
+
/** Expects indexes to exist (in any order) */
|
|
137
|
+
expectIndexes(indexes: FieldIndex[]): this;
|
|
133
138
|
/** Overrides the currently expected set of active targets. */
|
|
134
139
|
expectActiveTargets(...targets: Array<{
|
|
135
140
|
query: Query;
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { IndexConfiguration } from '../../../src/api/index_configuration';
|
|
17
18
|
import { Query } from '../../../src/core/query';
|
|
18
19
|
import { TargetId } from '../../../src/core/types';
|
|
20
|
+
import { FieldIndex } from '../../../src/model/field_index';
|
|
19
21
|
import { JsonObject } from '../../../src/model/object_value';
|
|
20
22
|
import { TestSnapshotVersion } from '../../util/helpers';
|
|
21
23
|
import { ActiveTargetMap } from './spec_builder';
|
|
@@ -95,6 +97,10 @@ export interface SpecStep {
|
|
|
95
97
|
waitForPendingWrites?: true;
|
|
96
98
|
/** Fails the listed database actions. */
|
|
97
99
|
failDatabase?: false | PersistenceAction[];
|
|
100
|
+
/**
|
|
101
|
+
* Set Index Configuration
|
|
102
|
+
*/
|
|
103
|
+
setIndexConfiguration?: string | IndexConfiguration;
|
|
98
104
|
/**
|
|
99
105
|
* Run a queued timer task (without waiting for the delay to expire). See
|
|
100
106
|
* TimerId enum definition for possible values).
|
|
@@ -306,5 +312,7 @@ export interface StateExpectation {
|
|
|
306
312
|
acknowledgedDocs: string[];
|
|
307
313
|
rejectedDocs: string[];
|
|
308
314
|
};
|
|
315
|
+
/** Indexes */
|
|
316
|
+
indexes?: FieldIndex[];
|
|
309
317
|
}
|
|
310
318
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -929,6 +929,49 @@ export declare function getFirestore(app?: FirebaseApp): Firestore;
|
|
|
929
929
|
* `updateDoc()`
|
|
930
930
|
*/
|
|
931
931
|
export declare function increment(n: number): FieldValue;
|
|
932
|
+
/**
|
|
933
|
+
* The SDK definition of a Firestore index.
|
|
934
|
+
*/
|
|
935
|
+
export declare interface Index {
|
|
936
|
+
/** The ID of the collection to index. */
|
|
937
|
+
readonly collectionGroup: string;
|
|
938
|
+
/** A list of fields to index. */
|
|
939
|
+
readonly fields?: IndexField[];
|
|
940
|
+
[key: string]: unknown;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* A list of Firestore indexes to speed up local query execution.
|
|
944
|
+
*
|
|
945
|
+
* See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
|
|
946
|
+
* for a description of the format of the index definition.
|
|
947
|
+
*/
|
|
948
|
+
export declare interface IndexConfiguration {
|
|
949
|
+
/** A list of all Firestore indexes. */
|
|
950
|
+
readonly indexes?: Index[];
|
|
951
|
+
[key: string]: unknown;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* A single field element in an index configuration.
|
|
955
|
+
*/
|
|
956
|
+
export declare interface IndexField {
|
|
957
|
+
/** The field path to index. */
|
|
958
|
+
readonly fieldPath: string;
|
|
959
|
+
/**
|
|
960
|
+
* What type of array index to create. Set to `CONTAINS` for `array-contains`
|
|
961
|
+
* and `array-contains-any` indexes.
|
|
962
|
+
*
|
|
963
|
+
* Only one of `arrayConfig` or `order` should be set;
|
|
964
|
+
*/
|
|
965
|
+
readonly arrayConfig?: 'CONTAINS';
|
|
966
|
+
/**
|
|
967
|
+
* What type of array index to create. Set to `ASCENDING` or 'DESCENDING` for
|
|
968
|
+
* `==`, `!=`, `<=`, `<=`, `in` and `not-in` filters.
|
|
969
|
+
*
|
|
970
|
+
* Only one of `arrayConfig` or `order` should be set.
|
|
971
|
+
*/
|
|
972
|
+
readonly order?: 'ASCENDING' | 'DESCENDING';
|
|
973
|
+
[key: string]: unknown;
|
|
974
|
+
}
|
|
932
975
|
/**
|
|
933
976
|
* Initializes a new instance of {@link Firestore} with the provided settings.
|
|
934
977
|
* Can only be called before any other function, including
|
|
@@ -1471,7 +1514,54 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: WithFie
|
|
|
1471
1514
|
* to the backend (note that it won't resolve while you're offline).
|
|
1472
1515
|
*/
|
|
1473
1516
|
export declare function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
|
|
1474
|
-
|
|
1517
|
+
/**
|
|
1518
|
+
* Configures indexing for local query execution. Any previous index
|
|
1519
|
+
* configuration is overridden. The `Promise` resolves once the index
|
|
1520
|
+
* configuration has been persisted.
|
|
1521
|
+
*
|
|
1522
|
+
* The index entries themselves are created asynchronously. You can continue to
|
|
1523
|
+
* use queries that require indexing even if the indices are not yet available.
|
|
1524
|
+
* Query execution will automatically start using the index once the index
|
|
1525
|
+
* entries have been written.
|
|
1526
|
+
*
|
|
1527
|
+
* Indexes are only supported with IndexedDb persistence. Invoke either
|
|
1528
|
+
* `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()`
|
|
1529
|
+
* before setting an index configuration. If IndexedDb is not enabled, any
|
|
1530
|
+
* index configuration is ignored.
|
|
1531
|
+
*
|
|
1532
|
+
* @param firestore - The {@link Firestore} instance to configure indexes for.
|
|
1533
|
+
* @param configuration -The index definition.
|
|
1534
|
+
* @throws FirestoreError if the JSON format is invalid.
|
|
1535
|
+
* @returns A `Promise` that resolves once all indices are successfully
|
|
1536
|
+
* configured.
|
|
1537
|
+
*/
|
|
1538
|
+
export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Configures indexing for local query execution. Any previous index
|
|
1541
|
+
* configuration is overridden. The `Promise` resolves once the index
|
|
1542
|
+
* configuration has been persisted.
|
|
1543
|
+
*
|
|
1544
|
+
* The index entries themselves are created asynchronously. You can continue to
|
|
1545
|
+
* use queries that require indexing even if the indices are not yet available.
|
|
1546
|
+
* Query execution will automatically start using the index once the index
|
|
1547
|
+
* entries have been written.
|
|
1548
|
+
*
|
|
1549
|
+
* Indexes are only supported with IndexedDb persistence. Invoke either
|
|
1550
|
+
* `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()`
|
|
1551
|
+
* before setting an index configuration. If IndexedDb is not enabled, any
|
|
1552
|
+
* index configuration is ignored.
|
|
1553
|
+
*
|
|
1554
|
+
* The method accepts the JSON format exported by the Firebase CLI (`firebase
|
|
1555
|
+
* firestore:indexes`). If the JSON format is invalid, this method throws an
|
|
1556
|
+
* error.
|
|
1557
|
+
*
|
|
1558
|
+
* @param firestore - The {@link Firestore} instance to configure indexes for.
|
|
1559
|
+
* @param json -The JSON format exported by the Firebase CLI.
|
|
1560
|
+
* @throws FirestoreError if the JSON format is invalid.
|
|
1561
|
+
* @returns A `Promise` that resolves once all indices are successfully
|
|
1562
|
+
* configured.
|
|
1563
|
+
*/
|
|
1564
|
+
export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
|
|
1475
1565
|
/**
|
|
1476
1566
|
* Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
|
|
1477
1567
|
*
|