@procedures/mongo 0.15.0 → 0.16.0
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 +22 -0
- package/README.md +8 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/view-storage.d.ts +99 -0
- package/dist/storage/view-storage.d.ts.map +1 -0
- package/dist/storage/view-storage.js +189 -0
- package/dist/storage/view-storage.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +3 -0
- package/src/storage/index.ts +3 -0
- package/src/storage/view-storage.ts +243 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @procedures/mongo
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [deada4b]
|
|
8
|
+
- @procedures/client@0.16.0
|
|
9
|
+
- @procedures/collections@0.16.0
|
|
10
|
+
|
|
11
|
+
## 0.15.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- bce8f5c: New: `MongoViewStorage`, a read-only storage of one materialized view for the collection procedures (roadmap CLI-38). A `ViewMaterializer` writes a big rebuild as a new generation in groups, and then it changes the generation in the status of the view. During the rebuild, a plain query of the target reads the rows of two generations.
|
|
16
|
+
|
|
17
|
+
Each read of `MongoViewStorage` finds the current generation of the view one time, and reads only its rows (`viewFilter`). Thus `get`, `getAll`, `find`, `changes` and the other reads of the procedures give one whole generation. The key of a row is its text `_id` in the result of the pipeline. Each write rejects with `FORBIDDEN`, because only the materializer writes a target. Collections that are not views keep their storages, and nothing changes for them.
|
|
18
|
+
- Updated dependencies [c78da2d]
|
|
19
|
+
- Updated dependencies [d99b2d5]
|
|
20
|
+
- Updated dependencies [534e4ea]
|
|
21
|
+
- Updated dependencies [44fdd60]
|
|
22
|
+
- @procedures/client@0.15.1
|
|
23
|
+
- @procedures/collections@0.15.1
|
|
24
|
+
|
|
3
25
|
## 0.15.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -742,6 +742,14 @@ const totals = await db.collection("orderTotals").find(viewFilter(view)).toArray
|
|
|
742
742
|
- A pass keeps in memory the key of each row of the result (at most `maxRows`) and one group of rows. It keeps nothing between passes.
|
|
743
743
|
- An app with targets from an older materializer (the plain key as `_id`, no generation) needs no migration step. The first pass of each view writes its rows in a generation, and removes the rows of its partition with no generation. A row without the partition field stays.
|
|
744
744
|
|
|
745
|
+
To serve a view through the collection procedures, give its storage `new MongoViewStorage({ view: "totals", db })` (roadmap CLI-38):
|
|
746
|
+
|
|
747
|
+
- Each read finds the current generation of the view one time, and reads only its rows. A reader of `get`, `getAll`, `find` or `changes` thus gets one generation only.
|
|
748
|
+
- A read that starts before a change of generation ends on the previous generation. The materializer keeps its rows for `generationGrace`, so a read must end in that time.
|
|
749
|
+
- The key of a row is its `_id` in the result, a text. The value has that `_id` and the fields of the row.
|
|
750
|
+
- The storage is read-only: a write rejects with `FORBIDDEN`. It has no change log.
|
|
751
|
+
- Give it the same `views`, `partitionField`, `statusField` and `targetId` as the materializer.
|
|
752
|
+
|
|
745
753
|
## Integration with Ecosystem
|
|
746
754
|
|
|
747
755
|
### Bundle Packages
|