@procedures/mongo 0.34.0 → 0.35.1
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 +69 -0
- package/README.md +61 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +2 -2
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +4 -5
- package/dist/module.js.map +1 -1
- package/dist/procedures/input-schemas.d.ts.map +1 -1
- package/dist/procedures/input-schemas.js +29 -2
- package/dist/procedures/input-schemas.js.map +1 -1
- package/dist/storage/document-storage.d.ts +338 -10
- package/dist/storage/document-storage.d.ts.map +1 -1
- package/dist/storage/document-storage.js +704 -75
- package/dist/storage/document-storage.js.map +1 -1
- package/dist/storage/index.d.ts +5 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +4 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/materializer.d.ts +27 -12
- package/dist/storage/materializer.d.ts.map +1 -1
- package/dist/storage/materializer.js +44 -15
- package/dist/storage/materializer.js.map +1 -1
- package/dist/storage/own-writes.d.ts +51 -0
- package/dist/storage/own-writes.d.ts.map +1 -0
- package/dist/storage/own-writes.js +130 -0
- package/dist/storage/own-writes.js.map +1 -0
- package/dist/storage/storage-hints.d.ts +230 -0
- package/dist/storage/storage-hints.d.ts.map +1 -0
- package/dist/storage/storage-hints.js +876 -0
- package/dist/storage/storage-hints.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +15 -3
- package/src/module.ts +5 -5
- package/src/procedures/input-schemas.ts +29 -2
- package/src/storage/document-storage.ts +832 -75
- package/src/storage/index.ts +15 -3
- package/src/storage/materializer.ts +61 -22
- package/src/storage/own-writes.ts +157 -0
- package/src/storage/storage-hints.ts +971 -0
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* `{ _id, data }` documents.
|
|
5
5
|
*
|
|
6
6
|
* The documents:
|
|
7
|
-
* - An item that is a plain object
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* - An item that is a plain object is stored flat: its fields beside the fields of the storage. A
|
|
8
|
+
* key with `$` or a dot below the top level, and a top-level key with a dot, stay as they are
|
|
9
|
+
* (MongoDB 5.0 or later keeps them). Another item is stored as JSON text in `_json`: null, a
|
|
10
|
+
* primitive, an array, an object with a top-level key of the storage or a top-level key that
|
|
11
|
+
* starts with `$`, a key `__proto__`, or a class instance other than `Date`. Both ways give the
|
|
12
|
+
* item back as it was. An object with a text `$ref` and an `$id` is refused (`TypeError`):
|
|
13
|
+
* MongoDB gives it back as a `DBRef`.
|
|
11
14
|
* - An item whose `_id` is its id keeps it: the storage gives it back.
|
|
12
15
|
* - The fields of the storage: `_key` (the id), `_part` (the partition), `_seq` (the sequence
|
|
13
16
|
* number of the last write), `_ord` (the number of the first write: the order of the entries, as
|
|
@@ -16,6 +19,40 @@
|
|
|
16
19
|
* character U+001F. Each partition reads and writes only its documents: each write filter has the
|
|
17
20
|
* partition too, so a write of a stored `_id` of another partition fails and changes nothing.
|
|
18
21
|
*
|
|
22
|
+
* The stored form (roadmap CLI-76): an app with its own form of documents keeps it with the option
|
|
23
|
+
* `form`, one `StoredForm` object. `DEFAULT_STORED_FORM` gives the form above, byte for byte.
|
|
24
|
+
* - `storedId(partition, id)` gives the stored `_id`, and `idOf(storedId, partition)` is its inverse.
|
|
25
|
+
* The stored `_id` can be any value but `undefined` and `null`, for example `tenant:key`.
|
|
26
|
+
* - `partitionFields(partition)` gives the fields that name the partition (default `{ _part }`).
|
|
27
|
+
* Each document of the partition has them, and they are the filter of the partition. A field with
|
|
28
|
+
* the value `undefined` is absent: the document does not have it, and the filter is
|
|
29
|
+
* `{ $exists: false }`. An item can have a partition field (one that is not a field of the
|
|
30
|
+
* storage) with the value of its partition: the write leaves it out and notes it in `_kpf`, and
|
|
31
|
+
* the read gives it back. The same field with another value is refused (`TypeError`).
|
|
32
|
+
* - `partitionOf(doc)` gives the partition of a stored document, for `ViewMaterializer`. A delete
|
|
33
|
+
* event has only the `documentKey`: so the `_id` must tell the partition, or the collection needs
|
|
34
|
+
* `changeStreamPreAndPostImages`.
|
|
35
|
+
* - The storage adds its fields (`_key`, `_seq`, `_ord`, `_tomb`, and `_kid` or `_json` as needed)
|
|
36
|
+
* in each form. A reader of the raw documents can leave them out (`DOCUMENT_STORAGE_FIELDS`), and
|
|
37
|
+
* must leave out the tombstones (`TOMBSTONE_FIELD` is `true`). `decodeStoredDocument(doc)` does
|
|
38
|
+
* this, as the storage reads a document.
|
|
39
|
+
* - A document without the fields of the storage (for example one written before the app used the
|
|
40
|
+
* storage) is an item too. Its id comes from `idOf`, else from `_key`, and its item gets that id
|
|
41
|
+
* as `_id`. Its partition fields follow the rule of a written document without `_kpf`: a field
|
|
42
|
+
* with the value of the partition stays out, and a field with another value stays in. So the
|
|
43
|
+
* item has the same form before and after its first write. A document whose id neither
|
|
44
|
+
* tells (for example an `ObjectId` that `idOf` does not name) is not an item: the reads and
|
|
45
|
+
* `size()` leave it out. Its version is `0`, and it comes before the other items in the order of
|
|
46
|
+
* the entries (then by `_id`). A full result of the change log has it, and a delta has it after
|
|
47
|
+
* its first write through the storage. That write gives it its fields and a version, and keeps
|
|
48
|
+
* its place.
|
|
49
|
+
* - Write through the storage. A raw write (for example `findOneAndReplace` or a script) takes no
|
|
50
|
+
* number of the sequence, so a delta of the change log does not give it, and a raw replace drops
|
|
51
|
+
* `_seq`.
|
|
52
|
+
* - A raw writer must not hard-delete an item while the storage writes it. The write of a document
|
|
53
|
+
* without `_seq` is an upsert with `{ _seq: { $exists: false } }`: after a hard delete between
|
|
54
|
+
* the read and the write, the upsert inserts the document again.
|
|
55
|
+
*
|
|
19
56
|
* The change log:
|
|
20
57
|
* - Each write gets the next number of the sequence of the collection. `_seq` is also the version
|
|
21
58
|
* of the item (`versionOf`).
|
|
@@ -31,6 +68,9 @@
|
|
|
31
68
|
* its lease moves its documents to new numbers, so a reader that passed the old numbers gets
|
|
32
69
|
* it. One case stays on a single server: a process that stops between such a late write and the
|
|
33
70
|
* move of its documents. Then a reader that passed the old numbers does not get that change.
|
|
71
|
+
* - The storage uses a transaction only with a client: the option `client`, or the default
|
|
72
|
+
* connection when `db` is absent. With `db` and no `client`, each write uses the watermark, also
|
|
73
|
+
* on a replica set.
|
|
34
74
|
*
|
|
35
75
|
* The queries: `query()` sends the conditions that MongoDB tests in the same way (the equality of
|
|
36
76
|
* a string, a number or a boolean, and `$in` of them) as a filter. `queryEntries()` of the core
|
|
@@ -45,13 +85,63 @@
|
|
|
45
85
|
* precondition has the `_seq` that the test read in its filter (a compare-and-set). Another writer
|
|
46
86
|
* between the test and the write makes the write fail with `VersionConflictError`. Then a batch of
|
|
47
87
|
* more than one item can keep a part of its writes: only a transaction makes a batch all or nothing.
|
|
88
|
+
* One case stays on a single server: a writer outside the storage that writes a document without
|
|
89
|
+
* `_seq` between the test and the write. The guard of such a document is `{ _seq: { $exists:
|
|
90
|
+
* false } }`, so it does not see that writer. On a replica set, the test and the write are one
|
|
91
|
+
* transaction, and this case does not occur.
|
|
48
92
|
*/
|
|
49
|
-
import type
|
|
93
|
+
import { type Db, type Document, type MongoClient } from "mongodb";
|
|
50
94
|
import { type CollectionStorage, type StorageBatchWriteOptions, type StorageChanges, type StorageItemWriteOptions, type StorageMetadata, type StoragePatch, type StorageQueryOptions, type StorageQueryPolicy, type StorageSelector, type StorageWriteOptions } from "@procedures/collections";
|
|
51
95
|
import { type Duration } from "@procedures/client";
|
|
52
96
|
import { type PipelineLimits } from "./pipeline-scope.js";
|
|
53
97
|
/** The separator of the partition and the id in a stored `_id`. */
|
|
54
98
|
export declare const SEPARATOR = "\u001F";
|
|
99
|
+
/**
|
|
100
|
+
* The fields that a `MongoDocumentStorage` can add to a stored document, in each stored form
|
|
101
|
+
* (roadmap CLI-76). A reader of the raw documents can leave them out. The partition fields are
|
|
102
|
+
* not in the list.
|
|
103
|
+
*/
|
|
104
|
+
export declare const DOCUMENT_STORAGE_FIELDS: readonly string[];
|
|
105
|
+
/** The field that is `true` in a tombstone: the document of a deleted item. A reader of the raw documents leaves them out. */
|
|
106
|
+
export declare const TOMBSTONE_FIELD: "_tomb";
|
|
107
|
+
/**
|
|
108
|
+
* The stored form of a `MongoDocumentStorage` (roadmap CLI-76): how an id and a partition become a
|
|
109
|
+
* stored document, and back. Give the same object to the storage (`form`) and to a
|
|
110
|
+
* `ViewMaterializer` (`storageSources`), or read it from `storage.form`.
|
|
111
|
+
*/
|
|
112
|
+
export interface StoredForm {
|
|
113
|
+
/**
|
|
114
|
+
* The stored `_id` of an id in a partition. It must give a value other than `undefined` and
|
|
115
|
+
* `null`, and two ids of one partition must not give the same value.
|
|
116
|
+
*/
|
|
117
|
+
storedId(partition: string | undefined, id: string): unknown;
|
|
118
|
+
/** The inverse of `storedId`: the id of a stored `_id`, or `undefined` when the `_id` is not of the partition. */
|
|
119
|
+
idOf(storedId: unknown, partition: string | undefined): string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* The fields that name a partition. Each document of the partition has them, and they are the
|
|
122
|
+
* filter of the partition. A field with the value `undefined` is absent: the document does not
|
|
123
|
+
* have it, and the filter is `{ $exists: false }`. Give the same names for each partition. A
|
|
124
|
+
* top-level field of an item with one of these names and the value of the partition is left out
|
|
125
|
+
* of the stored fields and noted in `_kpf`, and the read gives it back. Another value is refused
|
|
126
|
+
* with a `TypeError`.
|
|
127
|
+
*/
|
|
128
|
+
partitionFields(partition: string | undefined): Readonly<Record<string, unknown>>;
|
|
129
|
+
/**
|
|
130
|
+
* The partition of a stored document, or `undefined` when the document does not tell it. A
|
|
131
|
+
* `ViewMaterializer` gives the document of a change event: `fullDocument`, else
|
|
132
|
+
* `fullDocumentBeforeChange`, else `documentKey`. A delete event has only `documentKey`, so with
|
|
133
|
+
* another `storedId`, the `_id` must tell the partition, or the collection needs
|
|
134
|
+
* `changeStreamPreAndPostImages`. The storage writes a delete as a tombstone (a replace event with
|
|
135
|
+
* the whole document), so the gap is only for a raw hard delete.
|
|
136
|
+
*/
|
|
137
|
+
partitionOf(doc: Document): string | undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The default stored form, the form of 0.34.0. The stored `_id` is the id, or `<partition>` +
|
|
141
|
+
* U+001F + `<id>` with a partition. The partition field is `_part` (absent without a partition).
|
|
142
|
+
* `partitionOf` reads `_part`, else the part of `_id` before U+001F.
|
|
143
|
+
*/
|
|
144
|
+
export declare const DEFAULT_STORED_FORM: StoredForm;
|
|
55
145
|
/** The options of a `MongoDocumentStorage`. */
|
|
56
146
|
export interface MongoDocumentStorageOptions<T = unknown> {
|
|
57
147
|
/** The MongoDB collection. */
|
|
@@ -73,7 +163,8 @@ export interface MongoDocumentStorageOptions<T = unknown> {
|
|
|
73
163
|
writeLease?: Duration | undefined;
|
|
74
164
|
/**
|
|
75
165
|
* The client of the database, for the transactions. The default is the client of the default
|
|
76
|
-
* connection when `db` is absent. Without a client, the writes use the watermark
|
|
166
|
+
* connection when `db` is absent. Without a client, the writes use the watermark: with `db` and
|
|
167
|
+
* no `client`, a write is not a transaction, also on a replica set.
|
|
77
168
|
*/
|
|
78
169
|
client?: (() => MongoClient | Promise<MongoClient>) | undefined;
|
|
79
170
|
/**
|
|
@@ -89,12 +180,153 @@ export interface MongoDocumentStorageOptions<T = unknown> {
|
|
|
89
180
|
* the sequence number of the last write.
|
|
90
181
|
*/
|
|
91
182
|
versionOf?: ((item: T) => string | undefined) | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* The stored form (roadmap CLI-76): the stored `_id`, its inverse, the partition fields and the
|
|
185
|
+
* partition of a document. The default `DEFAULT_STORED_FORM` writes the documents of 0.34.0.
|
|
186
|
+
*/
|
|
187
|
+
form?: StoredForm | undefined;
|
|
188
|
+
}
|
|
189
|
+
/** The options of `decodeStoredDocument`. */
|
|
190
|
+
export interface DecodeStoredDocumentOptions {
|
|
191
|
+
/** The stored form of the storage, for example `storage.form` (default `DEFAULT_STORED_FORM`). */
|
|
192
|
+
form?: StoredForm | undefined;
|
|
193
|
+
/** The partition of the document. The default is `form.partitionOf(doc)`. */
|
|
194
|
+
partition?: string | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* True (the default): an item that is a plain object without `_id` gets its id as `_id`. False:
|
|
197
|
+
* the item is as the storage gives it, with `_id` only when it had it.
|
|
198
|
+
*/
|
|
199
|
+
addId?: boolean | undefined;
|
|
200
|
+
}
|
|
201
|
+
/** An item of a stored document, from `decodeStoredDocument`. */
|
|
202
|
+
export interface StoredDocumentEntry<T> {
|
|
203
|
+
/** The id of the item. */
|
|
204
|
+
id: string;
|
|
205
|
+
/** The partition of the document. */
|
|
206
|
+
partition: string | undefined;
|
|
207
|
+
/** The item. */
|
|
208
|
+
item: T;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* This function reads a raw document of a `MongoDocumentStorage` collection as the storage reads
|
|
212
|
+
* it (roadmap CLI-76), for an app that reads the collection directly (a query, a view, an
|
|
213
|
+
* aggregation). It gives `undefined` for a tombstone and for a document whose id neither `idOf`
|
|
214
|
+
* nor `_key` tells. Else it parses `_json`, leaves out the fields of the storage
|
|
215
|
+
* (`DOCUMENT_STORAGE_FIELDS`) and gives the item its id as `_id` (see `addId`).
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* const items = docs.flatMap((doc) => decodeStoredDocument<Note>(doc, { form: notes.form })?.item ?? []);
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
export declare function decodeStoredDocument<T = Document>(doc: Document, options?: DecodeStoredDocumentOptions): StoredDocumentEntry<T> | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* This function gives the version of a raw stored document of a `MongoDocumentStorage`: the
|
|
225
|
+
* version that `storage.versionOf(id)` gives for the same document (roadmap CLI-77). The storage
|
|
226
|
+
* uses it too, so the two never differ.
|
|
227
|
+
*
|
|
228
|
+
* - The version is the sequence number of the last write through the storage (`_seq`), as text.
|
|
229
|
+
* - A document without `_seq` (an old document, or one that a raw replace wrote) has the version `0`.
|
|
230
|
+
* - A tombstone, a value that is not a plain object, and a document whose id neither `idOf` nor
|
|
231
|
+
* `_key` tells give `undefined`: they are no items, as for `decodeStoredDocument`.
|
|
232
|
+
*
|
|
233
|
+
* @param doc - The stored document, for example the `fullDocument` of a change event
|
|
234
|
+
* @param form - The stored form of the storage, for example `storage.form` (default `DEFAULT_STORED_FORM`)
|
|
235
|
+
* @param partition - The partition of the document. The default is `form.partitionOf(doc)`.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const version = versionOfStored(change.fullDocument, notes.form); // the same as await notes.versionOf(id)
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
export declare function versionOfStored(doc: Document, form?: StoredForm, partition?: string): string | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* The parts of a storage that `watchStorageChanges` reads (roadmap CLI-77). The package does not
|
|
245
|
+
* export this type: it is for the modules of the storage.
|
|
246
|
+
*/
|
|
247
|
+
export interface StorageChangeSource {
|
|
248
|
+
/** The database of the storage. */
|
|
249
|
+
db(): Promise<Db>;
|
|
250
|
+
/** The MongoDB collection of the items. */
|
|
251
|
+
collection: string;
|
|
252
|
+
/** The collection of the sequence counters. */
|
|
253
|
+
counters: string;
|
|
254
|
+
/** The stored form. */
|
|
255
|
+
form: StoredForm;
|
|
256
|
+
/** The partition of the storage, or undefined for the storage of the whole collection. */
|
|
257
|
+
partition: string | undefined;
|
|
258
|
+
/** This method adopts a raw write (D39): see `RawStorageWrite`. */
|
|
259
|
+
adopt(raw: RawStorageWrite): Promise<RawAdoption>;
|
|
260
|
+
/**
|
|
261
|
+
* This method adopts several raw writes: the writes of each partition take one block of numbers.
|
|
262
|
+
* A partition whose writes fail gives `{ error }` for each of its writes.
|
|
263
|
+
*/
|
|
264
|
+
adoptAll(raws: readonly RawStorageWrite[]): Promise<RawAdoptionResult[]>;
|
|
265
|
+
/**
|
|
266
|
+
* One page of the documents without `_seq` (the sweep of the raw writes), in the order of `_id`,
|
|
267
|
+
* after the `_id` of `after` (from the start without it).
|
|
268
|
+
*/
|
|
269
|
+
rawDocuments(after: {
|
|
270
|
+
readonly id: unknown;
|
|
271
|
+
} | undefined, limit: number): Promise<Document[]>;
|
|
272
|
+
/** The stored documents of these stored `_id`s: the watcher adopts a raw write again after a full queue or a failure. */
|
|
273
|
+
storedDocuments(ids: readonly unknown[]): Promise<Document[]>;
|
|
274
|
+
/**
|
|
275
|
+
* The partitions that the storage knows: each partition with a floor document in the counters
|
|
276
|
+
* (the first write of a storage and each prune write one), and each partition of
|
|
277
|
+
* `forPartition()` in this process. It rejects when the counters cannot be read.
|
|
278
|
+
*/
|
|
279
|
+
partitions(): Promise<Array<string | undefined>>;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A raw write of the collection (D39): a change event of a document that the storage did not write.
|
|
283
|
+
* The storage adopts it: one conditional write gives the document a new `_seq` through the path of
|
|
284
|
+
* each write (the transaction, or the watermark and the late move), so `changes(since)` has it.
|
|
285
|
+
*
|
|
286
|
+
* - The filter is the stored `_id` and the `_seq` that the event saw (or no `_seq`): when the
|
|
287
|
+
* document changed since (a later adoption, or a write of the storage), the adoption does
|
|
288
|
+
* nothing. Thus one adoption wins.
|
|
289
|
+
* - The adoption sets `_seq`, and the storage fields and partition fields that the document does
|
|
290
|
+
* not have: from the image before the change, else from the stored `_id` (`form.idOf()`,
|
|
291
|
+
* `form.partitionOf()`). It never changes a field of the item.
|
|
292
|
+
* - A hard delete (no `after`) needs the image before the change: the adoption inserts a tombstone
|
|
293
|
+
* with a new `_seq`, and the insert fails when the `_id` exists again.
|
|
294
|
+
* - The numbers of an adoption are never noted as numbers of this process: its change event is
|
|
295
|
+
* the hint of the raw write.
|
|
296
|
+
*/
|
|
297
|
+
export interface RawStorageWrite {
|
|
298
|
+
/** The stored `_id` of the document (`documentKey._id`). */
|
|
299
|
+
readonly storedId: unknown;
|
|
300
|
+
/** The `_seq` of the state that the event saw, or undefined for a document without `_seq`. */
|
|
301
|
+
readonly seq: number | undefined;
|
|
302
|
+
/** The document after the write, or undefined for a hard delete. */
|
|
303
|
+
readonly after?: Document | undefined;
|
|
304
|
+
/** The image of the document before the change, when the collection keeps it (`changeStreamPreAndPostImages`). */
|
|
305
|
+
readonly before?: Document | undefined;
|
|
306
|
+
}
|
|
307
|
+
/** The result of an adoption: `adopted`, `lost` (the document changed since: another adoption or write won), or `unknown` (no image and no stored `_id` tells the id and the partition). */
|
|
308
|
+
export type RawAdoption = "adopted" | "lost" | "unknown";
|
|
309
|
+
/** The result of one raw write of `adoptAll()`: a `RawAdoption`, or the error of the write of its partition. */
|
|
310
|
+
export type RawAdoptionResult = RawAdoption | {
|
|
311
|
+
readonly error: unknown;
|
|
312
|
+
};
|
|
313
|
+
/** This function gives the parts of a storage that `watchStorageChanges` reads. The package does not export it. */
|
|
314
|
+
export declare function storageChangeSource<T>(storage: MongoDocumentStorage<T>): StorageChangeSource;
|
|
315
|
+
/** The options of `selectorPrefilter`. */
|
|
316
|
+
export interface SelectorPrefilterOptions {
|
|
317
|
+
/**
|
|
318
|
+
* The stored `_id` of an id. With it, a condition on `_id` with text values tests the stored
|
|
319
|
+
* `_id` (and uses its index). Without it, the condition tests `_key`.
|
|
320
|
+
*/
|
|
321
|
+
storedId?: ((id: string) => unknown) | undefined;
|
|
322
|
+
/** More fields that only the storage writes, for example the partition fields: a condition on one of them does not go in the filter. */
|
|
323
|
+
storageFields?: Iterable<string> | undefined;
|
|
92
324
|
}
|
|
93
325
|
/**
|
|
94
326
|
* This function gives a filter that each item of the selector passes (a filter can pass more),
|
|
95
327
|
* or undefined for no condition. Only conditions that MongoDB tests in the same way go in it.
|
|
96
328
|
*/
|
|
97
|
-
export declare function selectorPrefilter(selector: StorageSelector): Document | undefined;
|
|
329
|
+
export declare function selectorPrefilter(selector: StorageSelector, options?: SelectorPrefilterOptions): Document | undefined;
|
|
98
330
|
/**
|
|
99
331
|
* A `CollectionStorage` over MongoDB with flat documents, a change log, versions, queries in the
|
|
100
332
|
* database and partitions (roadmap CLI-24).
|
|
@@ -114,7 +346,17 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
114
346
|
private readonly writeLeaseMs;
|
|
115
347
|
/** The storages of the partitions, for `forPartition`: the same storage for the same partition. */
|
|
116
348
|
private readonly partitions;
|
|
349
|
+
/** The stored form of the documents (roadmap CLI-76). A `ViewMaterializer` of the collection takes the same form. */
|
|
350
|
+
readonly form: StoredForm;
|
|
351
|
+
/** The fields that name the partition, in their order. An `undefined` value is an absent field. */
|
|
352
|
+
private readonly partitionEntries;
|
|
353
|
+
/** The values of the partition fields that are not fields of the storage, by name. */
|
|
354
|
+
private readonly partitionValues;
|
|
355
|
+
/** The fields that only the storage writes: its fields and the partition fields. */
|
|
356
|
+
private readonly reserved;
|
|
117
357
|
private indexes;
|
|
358
|
+
/** True after this storage wrote (or found) the floor document of its partition (roadmap O66). A failed write leaves it false. */
|
|
359
|
+
private floorNoted;
|
|
118
360
|
private closed;
|
|
119
361
|
constructor(options: MongoDocumentStorageOptions<T>, partitions?: Map<string, MongoDocumentStorage<T>>);
|
|
120
362
|
/** The storage of a partition of the same collection. It gives the same storage for the same partition. */
|
|
@@ -123,16 +365,32 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
123
365
|
private collection;
|
|
124
366
|
/** The filter of the documents of the partition. */
|
|
125
367
|
private partitionFilter;
|
|
368
|
+
/** This method puts the partition fields on a stored document, in their order. An absent field stays absent. */
|
|
369
|
+
private putPartition;
|
|
126
370
|
/** The filter of the items (not the tombstones) of the partition. */
|
|
127
371
|
private liveFilter;
|
|
128
372
|
/** The stored `_id` of an id. An id with the separator could name an item of a partition: it is refused. */
|
|
129
373
|
private storedId;
|
|
374
|
+
/** The id of a stored document: the inverse of its stored `_id`, else `_key`, or undefined when neither tells it. */
|
|
375
|
+
private idOfDoc;
|
|
376
|
+
/** The place of a stored document in the order of the entries. A document without `_ord` comes first. */
|
|
377
|
+
private placeOf;
|
|
130
378
|
/** The filter of a write of one stored document: its `_id` and the partition. */
|
|
131
379
|
private writeFilter;
|
|
132
380
|
/** The stored document of an item, with the number of this write and the number of its place. */
|
|
133
381
|
private encode;
|
|
134
|
-
/**
|
|
382
|
+
/**
|
|
383
|
+
* The fields of the flat document of an item, or undefined when only JSON text keeps it: an item
|
|
384
|
+
* that is not a plain object, an `_id` other than its id, a top-level key of the storage or with
|
|
385
|
+
* `$`, a key `__proto__`, a class instance other than `Date`. It throws a `TypeError` for a flat
|
|
386
|
+
* item that a document cannot keep: a partition field with another value than the partition, or
|
|
387
|
+
* an object that MongoDB gives back as a `DBRef`.
|
|
388
|
+
*/
|
|
389
|
+
private flatOf;
|
|
390
|
+
/** The id and the item of a stored document, or undefined when the document does not tell its id. */
|
|
135
391
|
private decode;
|
|
392
|
+
/** The entries of stored documents, in their order. A document that does not tell its id is left out. */
|
|
393
|
+
private decodeAll;
|
|
136
394
|
/**
|
|
137
395
|
* The next `count` numbers of the sequence of the collection. They stay pending in the counter
|
|
138
396
|
* document until `release()`, so the watermark of the readers stays below them.
|
|
@@ -152,7 +410,8 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
152
410
|
/**
|
|
153
411
|
* This method takes numbers and writes with them. On a replica set, the two are one
|
|
154
412
|
* transaction. Else the numbers stay pending until the write ends, and a late write moves its
|
|
155
|
-
* documents to new numbers.
|
|
413
|
+
* documents to new numbers. With `own` false (an adoption of a raw write, D39), a watcher of this
|
|
414
|
+
* process does not take the numbers as its own.
|
|
156
415
|
*/
|
|
157
416
|
private withNumbers;
|
|
158
417
|
/**
|
|
@@ -162,8 +421,26 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
162
421
|
private watermark;
|
|
163
422
|
/** The id of the document of the oldest kept change of the partition. */
|
|
164
423
|
private floorId;
|
|
424
|
+
/**
|
|
425
|
+
* This method writes the floor document of the partition once for this storage, before its first
|
|
426
|
+
* write (roadmap O66). Then `knownPartitions()` of each process finds the partition, also without
|
|
427
|
+
* a prune, and a gap of `watchStorageChanges()` sends it a reset hint.
|
|
428
|
+
*
|
|
429
|
+
* - The floor `0` is neutral: `getChangesSince` gives a full result only for a version below the
|
|
430
|
+
* floor, and a version is never below `0`. A missing floor document also reads as `0`. So the
|
|
431
|
+
* document changes no result of the change log.
|
|
432
|
+
* - `$setOnInsert` writes only a new document: a floor of a prune (`$max`) stays as it is.
|
|
433
|
+
* - A duplicate key (another process inserted the same document first) is a success.
|
|
434
|
+
* - The upsert runs in the queue of the writes, before the task, so never in the transaction of
|
|
435
|
+
* `withNumbers()`: it adds no write conflict to the transaction of the user, and a transaction
|
|
436
|
+
* that tries again does not write it again.
|
|
437
|
+
* - A failure does not fail the write of the user. The flag stays false, so the next write tries again.
|
|
438
|
+
*/
|
|
439
|
+
private noteFloor;
|
|
165
440
|
/** This method drops the oldest tombstones of the partition over the limit, and keeps the floor of the log. */
|
|
166
441
|
private pruneTombstones;
|
|
442
|
+
/** The ids of stored documents, in their order. A document that does not tell its id is left out. */
|
|
443
|
+
private idsOf;
|
|
167
444
|
/** The items of the partition, in the order of the entries. */
|
|
168
445
|
private liveDocs;
|
|
169
446
|
/** The places (`_ord`) of the items of some ids that the partition has. */
|
|
@@ -188,7 +465,11 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
188
465
|
docs: Document[];
|
|
189
466
|
truncated: boolean;
|
|
190
467
|
}>;
|
|
191
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* The version of an item: the sequence number of its last write, or undefined for a missing id.
|
|
470
|
+
* An item without a write through the storage (no `_seq`) has the version `0`. It is the version
|
|
471
|
+
* of `versionOfStored()` of the stored document (roadmap CLI-77): the two share one rule.
|
|
472
|
+
*/
|
|
192
473
|
versionOf(id: string): Promise<string | undefined>;
|
|
193
474
|
getChangesSince(since?: string): Promise<StorageChanges<T>>;
|
|
194
475
|
private write;
|
|
@@ -211,6 +492,53 @@ export declare class MongoDocumentStorage<T> implements CollectionStorage<T> {
|
|
|
211
492
|
* collection. With preconditions, it tests them first (roadmap CLI-16).
|
|
212
493
|
*/
|
|
213
494
|
private tombstone;
|
|
495
|
+
/**
|
|
496
|
+
* This method adopts a raw write: one conditional write through the path of each write gives the
|
|
497
|
+
* document a new `_seq` (see `RawStorageWrite`). It is for `watchStorageChanges()`, and it is no
|
|
498
|
+
* general setter of `_seq`.
|
|
499
|
+
*/
|
|
500
|
+
private adoptRaw;
|
|
501
|
+
/**
|
|
502
|
+
* This method adopts several raw writes. The writes of each partition take one block of numbers
|
|
503
|
+
* through the path of each write. A number of a write that does not win stays unused.
|
|
504
|
+
*/
|
|
505
|
+
private adoptRawAll;
|
|
506
|
+
/** The adoption of raw writes of this partition, with one block of numbers. */
|
|
507
|
+
private adoptGroup;
|
|
508
|
+
/** A raw hard delete: a tombstone with the id and the partition of the image before the change. */
|
|
509
|
+
private adoptDelete;
|
|
510
|
+
/** A raw insert, replace or update: one conditional write on the exact state of the event. */
|
|
511
|
+
private adoptWrite;
|
|
512
|
+
/** One page of the documents without `_seq`, in the order of `_id` (the sweep of `watchStorageChanges()`). */
|
|
513
|
+
private rawDocuments;
|
|
514
|
+
/** The stored documents of these stored `_id`s, for the adoptions that `watchStorageChanges()` does again. */
|
|
515
|
+
private storedDocuments;
|
|
516
|
+
/**
|
|
517
|
+
* The storage of the partition of a raw write and the id of its document, or undefined when
|
|
518
|
+
* neither the documents of the event nor the stored `_id` tell them. The partition comes from
|
|
519
|
+
* `form.partitionOf()` of the image before the change, else of the document after the write,
|
|
520
|
+
* else of the stored `_id` (the order of `storageChangeOf()`). The document must not have a
|
|
521
|
+
* partition field with another value.
|
|
522
|
+
*/
|
|
523
|
+
private adoptionTarget;
|
|
524
|
+
/** True when each partition field of a document has the value of this partition, or is absent (a raw replace can drop it). */
|
|
525
|
+
private holds;
|
|
526
|
+
/**
|
|
527
|
+
* The storage fields and the partition fields that a raw write took from the document, for the
|
|
528
|
+
* adoption to set again. No field of the item is in it.
|
|
529
|
+
*
|
|
530
|
+
* - The partition fields of this partition that the document does not have.
|
|
531
|
+
* - `_key` (with `_kid`) of the image before the change. Without the image, `_key` only when
|
|
532
|
+
* `form.idOf()` does not tell the id, with `_kid`: the item keeps its `_id`, as a document from
|
|
533
|
+
* outside the storage.
|
|
534
|
+
* - `_ord` of the image before the change, else `0`, the place of a document without `_ord`
|
|
535
|
+
* (the rule of the old documents).
|
|
536
|
+
* - The names of `_kpf` of the image before the change that the document has with the value of
|
|
537
|
+
* the partition.
|
|
538
|
+
*/
|
|
539
|
+
private restoredFields;
|
|
540
|
+
/** The partitions that the storage knows: the floor documents of the counters (of the first writes and of the prunes), and the storages of `forPartition()`. */
|
|
541
|
+
private knownPartitions;
|
|
214
542
|
/**
|
|
215
543
|
* The preconditions of a write (roadmap CLI-16), after a check of their ids. A storage without
|
|
216
544
|
* `versionOf` throws a `TypeError` before the write starts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-storage.d.ts","sourceRoot":"","sources":["../../src/storage/document-storage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"document-storage.d.ts","sourceRoot":"","sources":["../../src/storage/document-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAIH,OAAO,EAAyE,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAe,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AACvJ,OAAO,EAML,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,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