@toa.io/storages.mongodb 1.0.0-alpha.33 → 1.0.0-alpha.330
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 +357 -0
- package/package.json +10 -9
- package/readme.md +38 -0
- package/src/client.js +181 -40
- package/src/factory.js +6 -12
- package/src/inbox.js +117 -0
- package/src/index.js +1 -7
- package/src/indexes.js +84 -0
- package/src/match.js +108 -0
- package/src/measurements.js +39 -0
- package/src/migrations.js +357 -0
- package/src/outbox.js +131 -0
- package/src/record.js +97 -8
- package/src/storage.js +554 -121
- package/src/streams.js +400 -0
- package/src/translate/criteria.js +25 -18
- package/src/translate/options.js +20 -11
- package/src/translate/rename.js +1 -5
- package/src/translate.js +14 -15
- package/test/match.test.js +70 -0
- package/test/migrations.test.js +388 -0
- package/test/query/criteria.fixtures.js +2 -7
- package/test/query/criteria.test.js +5 -4
- package/test/record.test.js +142 -15
- package/test/storage.test.js +319 -0
- package/test/streams.test.js +60 -0
- package/test/translate.test.js +59 -7
- package/types/connection.d.ts +18 -12
- package/types/pointer.d.ts +4 -6
- package/types/record.d.ts +5 -7
- package/src/collection.js +0 -71
- package/src/deployment.js +0 -22
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [1.0.0-alpha.330](https://github.com/toa-io/toa/compare/v1.0.0-alpha.329...v1.0.0-alpha.330) (2026-10-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.0.0-alpha.329](https://github.com/toa-io/toa/compare/v1.0.0-alpha.328...v1.0.0-alpha.329) (2026-10-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.0.0-alpha.328](https://github.com/toa-io/toa/compare/v1.0.0-alpha.327...v1.0.0-alpha.328) (2026-10-10)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [1.0.0-alpha.327](https://github.com/toa-io/toa/compare/v1.0.0-alpha.326...v1.0.0-alpha.327) (2026-10-10)
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **storages.mongodb:** pass a deleted record by when an effect gets or creates ([0cea640](https://github.com/toa-io/toa/commit/0cea6405021c8230e9b68a0f3086ff610332b34d))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# [1.0.0-alpha.326](https://github.com/toa-io/toa/compare/v1.0.0-alpha.325...v1.0.0-alpha.326) (2026-10-06)
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* **core:** parse criteria with [@toa](https://github.com/toa).io/rsql ([c4dc9f4](https://github.com/toa-io/toa/commit/c4dc9f41ca2719ac66607c5b14e9ead678baa740))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# [1.0.0-alpha.325](https://github.com/toa-io/toa/compare/v1.0.0-alpha.324...v1.0.0-alpha.325) (2026-10-02)
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* **storages.mongodb:** kill the cursor of a stream's position whatever type its id comes as ([71c799e](https://github.com/toa-io/toa/commit/71c799ec3694a41cc32890d9e21bb42573b96395))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# [1.0.0-alpha.324](https://github.com/toa-io/toa/compare/v1.0.0-alpha.323...v1.0.0-alpha.324) (2026-10-02)
|
|
52
|
+
|
|
53
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# [1.0.0-alpha.323](https://github.com/toa-io/toa/compare/v1.0.0-alpha.322...v1.0.0-alpha.323) (2026-10-01)
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
* **storages.mongodb:** store the moments an assignment sets as dates ([240102d](https://github.com/toa-io/toa/commit/240102db5b218e0b0a3a7b097c77852e749e76ef))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# [1.0.0-alpha.322](https://github.com/toa-io/toa/compare/v1.0.0-alpha.321...v1.0.0-alpha.322) (2026-09-29)
|
|
67
|
+
|
|
68
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# [1.0.0-alpha.321](https://github.com/toa-io/toa/compare/v1.0.0-alpha.320...v1.0.0-alpha.321) (2026-09-28)
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
* **storages.mongodb:** commit a set of entries all or nothing ([dafecf0](https://github.com/toa-io/toa/commit/dafecf096bac99c4aca5b697a0d7d9f6f6d82daf))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [1.0.0-alpha.320](https://github.com/toa-io/toa/compare/v1.0.0-alpha.319...v1.0.0-alpha.320) (2026-09-28)
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
* page a stream by CREATED, and stop it after its first page ([038dc52](https://github.com/toa-io/toa/commit/038dc52f2db1a4dd58c6ec58a00de8914b3d38a3))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# [1.0.0-alpha.319](https://github.com/toa-io/toa/compare/v1.0.0-alpha.318...v1.0.0-alpha.319) (2026-09-27)
|
|
89
|
+
|
|
90
|
+
### Features
|
|
91
|
+
|
|
92
|
+
* **storages.mongodb:** read a set and its changes from a token ([d0a8955](https://github.com/toa-io/toa/commit/d0a8955683b7566e704f7e9cde69f67272c7be1b))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# [1.0.0-alpha.318](https://github.com/toa-io/toa/compare/v1.0.0-alpha.317...v1.0.0-alpha.318) (2026-09-23)
|
|
96
|
+
|
|
97
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# [1.0.0-alpha.317](https://github.com/toa-io/toa/compare/v1.0.0-alpha.316...v1.0.0-alpha.317) (2026-09-23)
|
|
104
|
+
|
|
105
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# [1.0.0-alpha.316](https://github.com/toa-io/toa/compare/v1.0.0-alpha.315...v1.0.0-alpha.316) (2026-09-23)
|
|
112
|
+
|
|
113
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# [1.0.0-alpha.315](https://github.com/toa-io/toa/compare/v1.0.0-alpha.314...v1.0.0-alpha.315) (2026-09-23)
|
|
120
|
+
|
|
121
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# [1.0.0-alpha.314](https://github.com/toa-io/toa/compare/v1.0.0-alpha.313...v1.0.0-alpha.314) (2026-09-19)
|
|
128
|
+
|
|
129
|
+
* feat(core)!: let an operation state how long its calls are remembered ([af177c2](https://github.com/toa-io/toa/commit/af177c2ab3d00d475840b5ef9e612f04e82b72bd))
|
|
130
|
+
|
|
131
|
+
### BREAKING CHANGES
|
|
132
|
+
|
|
133
|
+
* `inbox.retention` under 600 is refused. See
|
|
134
|
+
migrations/313.md.
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# [1.0.0-alpha.313](https://github.com/toa-io/toa/compare/v1.0.0-alpha.312...v1.0.0-alpha.313) (2026-09-18)
|
|
138
|
+
|
|
139
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# [1.0.0-alpha.312](https://github.com/toa-io/toa/compare/v1.0.0-alpha.311...v1.0.0-alpha.312) (2026-09-18)
|
|
146
|
+
|
|
147
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# [1.0.0-alpha.311](https://github.com/toa-io/toa/compare/v1.0.0-alpha.310...v1.0.0-alpha.311) (2026-09-17)
|
|
154
|
+
|
|
155
|
+
### Features
|
|
156
|
+
|
|
157
|
+
* name the database after the scope ([4d7203f](https://github.com/toa-io/toa/commit/4d7203fd18828895272a9dae76e351d92b49277f))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# [1.0.0-alpha.310](https://github.com/toa-io/toa/compare/v1.0.0-alpha.309...v1.0.0-alpha.310) (2026-09-16)
|
|
161
|
+
|
|
162
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
# [1.0.0-alpha.309](https://github.com/toa-io/toa/compare/v1.0.0-alpha.308...v1.0.0-alpha.309) (2026-09-16)
|
|
169
|
+
|
|
170
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
# [1.0.0-alpha.308](https://github.com/toa-io/toa/compare/v1.0.0-alpha.307...v1.0.0-alpha.308) (2026-09-15)
|
|
177
|
+
|
|
178
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
# [1.0.0-alpha.307](https://github.com/toa-io/toa/compare/v1.0.0-alpha.306...v1.0.0-alpha.307) (2026-09-15)
|
|
185
|
+
|
|
186
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
# [1.0.0-alpha.306](https://github.com/toa-io/toa/compare/v1.0.0-alpha.305...v1.0.0-alpha.306) (2026-09-14)
|
|
193
|
+
|
|
194
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# [1.0.0-alpha.305](https://github.com/toa-io/toa/compare/v1.0.0-alpha.304...v1.0.0-alpha.305) (2026-09-13)
|
|
201
|
+
|
|
202
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
# [1.0.0-alpha.304](https://github.com/toa-io/toa/compare/v1.0.0-alpha.303...v1.0.0-alpha.304) (2026-09-13)
|
|
209
|
+
|
|
210
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# [1.0.0-alpha.303](https://github.com/toa-io/toa/compare/v1.0.0-alpha.302...v1.0.0-alpha.303) (2026-09-12)
|
|
217
|
+
|
|
218
|
+
### Features
|
|
219
|
+
|
|
220
|
+
* **metrics:** measure storage, stash, blob storages and fetch ([252298b](https://github.com/toa-io/toa/commit/252298bb9f34421694da4ee89742d62b47c39dfb))
|
|
221
|
+
|
|
222
|
+
### Performance Improvements
|
|
223
|
+
|
|
224
|
+
* **storages.mongodb:** rename a record's _id to id in place ([4aeb2a1](https://github.com/toa-io/toa/commit/4aeb2a1d61f7f2b0ddab203b5887152e8917ef7f))
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
# [1.0.0-alpha.302](https://github.com/toa-io/toa/compare/v1.0.0-alpha.301...v1.0.0-alpha.302) (2026-09-11)
|
|
228
|
+
|
|
229
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
# [1.0.0-alpha.301](https://github.com/toa-io/toa/compare/v1.0.0-alpha.300...v1.0.0-alpha.301) (2026-09-11)
|
|
236
|
+
|
|
237
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
# [1.0.0-alpha.300](https://github.com/toa-io/toa/compare/v1.0.0-alpha.299...v1.0.0-alpha.300) (2026-09-11)
|
|
244
|
+
|
|
245
|
+
* feat(core)!: an operation may ask to run once ([dca616c](https://github.com/toa-io/toa/commit/dca616cb380a7a389e277875d3bd5ca55a6e4d45))
|
|
246
|
+
|
|
247
|
+
### Bug Fixes
|
|
248
|
+
|
|
249
|
+
* **extensions:** what a factory remembers does not outlive the tree it was made for ([dd36631](https://github.com/toa-io/toa/commit/dd3663160f500eadfb701bf840ef3741a2d075f0))
|
|
250
|
+
|
|
251
|
+
### Features
|
|
252
|
+
|
|
253
|
+
* **core:** an assignment may ask to run once as well ([10fbcbd](https://github.com/toa-io/toa/commit/10fbcbd86a5e82960e65f62c09d0a465ae8d0353))
|
|
254
|
+
|
|
255
|
+
### BREAKING CHANGES
|
|
256
|
+
|
|
257
|
+
* `Storage.store`, `.upsert` and `.ensure` take one more
|
|
258
|
+
argument, and `Storage` has two more members. A connector that ignores them
|
|
259
|
+
works exactly as it did; a component that asks it for `once` is refused at
|
|
260
|
+
boot. See migrations/299.md.
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
# [1.0.0-alpha.299](https://github.com/toa-io/toa/compare/v1.0.0-alpha.298...v1.0.0-alpha.299) (2026-09-10)
|
|
264
|
+
|
|
265
|
+
### Features
|
|
266
|
+
|
|
267
|
+
* **core:** a record carries the region that wrote it ([13ed187](https://github.com/toa-io/toa/commit/13ed187604f06dec66feec2e26ccf9dae30bb048))
|
|
268
|
+
* **core:** an outbox row is published to destinations ([cfb77b4](https://github.com/toa-io/toa/commit/cfb77b4826ff0f9560769a0996981e143d6525af))
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
# [1.0.0-alpha.298](https://github.com/toa-io/toa/compare/v1.0.0-alpha.297...v1.0.0-alpha.298) (2026-09-08)
|
|
272
|
+
|
|
273
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
# [1.0.0-alpha.297](https://github.com/toa-io/toa/compare/v1.0.0-alpha.296...v1.0.0-alpha.297) (2026-09-08)
|
|
280
|
+
|
|
281
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
# [1.0.0-alpha.296](https://github.com/toa-io/toa/compare/v1.0.0-alpha.295...v1.0.0-alpha.296) (2026-09-08)
|
|
288
|
+
|
|
289
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
# [1.0.0-alpha.295](https://github.com/toa-io/toa/compare/v1.0.0-alpha.294...v1.0.0-alpha.295) (2026-09-07)
|
|
296
|
+
|
|
297
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
# [1.0.0-alpha.294](https://github.com/toa-io/toa/compare/v1.0.0-alpha.293...v1.0.0-alpha.294) (2026-09-07)
|
|
304
|
+
|
|
305
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
# [1.0.0-alpha.293](https://github.com/toa-io/toa/compare/v1.0.0-alpha.292...v1.0.0-alpha.293) (2026-09-07)
|
|
312
|
+
|
|
313
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
# [1.0.0-alpha.292](https://github.com/toa-io/toa/compare/v1.0.0-alpha.291...v1.0.0-alpha.292) (2026-09-07)
|
|
320
|
+
|
|
321
|
+
### Features
|
|
322
|
+
|
|
323
|
+
* **definitions:** what a package declares is read from one package ([7052341](https://github.com/toa-io/toa/commit/70523411b5d9e2b204c999aa02365173f3bb518d))
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
# [1.0.0-alpha.291](https://github.com/toa-io/toa/compare/v1.0.0-alpha.290...v1.0.0-alpha.291) (2026-09-07)
|
|
327
|
+
|
|
328
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
# [1.0.0-alpha.289](https://github.com/toa-io/toa/compare/v1.0.0-alpha.288...v1.0.0-alpha.289) (2026-09-07)
|
|
335
|
+
|
|
336
|
+
* A deploy moves only what changed, and a component sees none of the runtime's environment (#1073) ([f38e3db](https://github.com/toa-io/toa/commit/f38e3db533f24db866c57bfa1ef294eff1eaf499)), closes [#1073](https://github.com/toa-io/toa/issues/1073) [#1064](https://github.com/toa-io/toa/issues/1064) [#1066](https://github.com/toa-io/toa/issues/1066) [#1067](https://github.com/toa-io/toa/issues/1067) [#1068](https://github.com/toa-io/toa/issues/1068) [#1069](https://github.com/toa-io/toa/issues/1069) [#1071](https://github.com/toa-io/toa/issues/1071) [#1070](https://github.com/toa-io/toa/issues/1070) [#1072](https://github.com/toa-io/toa/issues/1072)
|
|
337
|
+
|
|
338
|
+
### BREAKING CHANGES
|
|
339
|
+
|
|
340
|
+
* a component that read `process.env.TOA_*` reads `context` instead;
|
|
341
|
+
`echo(input)` no longer substitutes from the environment; a bash operation sees no
|
|
342
|
+
`TOA_*`; images no longer set `USER node` — see migrations/289.md.
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
# [1.0.0-alpha.288](https://github.com/toa-io/toa/compare/v1.0.0-alpha.287...v1.0.0-alpha.288) (2026-09-06)
|
|
346
|
+
|
|
347
|
+
**Note:** Version bump only for package @toa.io/storages.mongodb
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
# [1.0.0-alpha.287](https://github.com/toa-io/toa/compare/v1.0.0-alpha.286...v1.0.0-alpha.287) (2026-09-06)
|
|
354
|
+
|
|
355
|
+
### Features
|
|
356
|
+
|
|
357
|
+
* **mongodb:** a migration says what it is doing ([a917a81](https://github.com/toa-io/toa/commit/a917a81fdc94eb23fd73182c0edf891e6b2df843))
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/storages.mongodb",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.330",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Toa MongoDB Storage Connector",
|
|
5
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
7
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -19,13 +20,13 @@
|
|
|
19
20
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@toa.io/
|
|
23
|
-
"@toa.io/
|
|
24
|
-
"@toa.io/
|
|
25
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
26
|
-
"@toa.io/pointer": "1.0.0-alpha.
|
|
27
|
-
"mongodb": "
|
|
28
|
-
"
|
|
23
|
+
"@toa.io/conveyor": "1.0.0-alpha.330",
|
|
24
|
+
"@toa.io/core": "1.0.0-alpha.330",
|
|
25
|
+
"@toa.io/definitions": "1.0.0-alpha.330",
|
|
26
|
+
"@toa.io/generic": "1.0.0-alpha.330",
|
|
27
|
+
"@toa.io/pointer": "1.0.0-alpha.330",
|
|
28
|
+
"mongodb": "7.7.0",
|
|
29
|
+
"openspan": "1.0.0-alpha.330"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "8d5b161d026b24ee1974005e1f418bc2b782fd3b"
|
|
31
32
|
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# MongoDB Storage
|
|
2
|
+
|
|
3
|
+
## Tracing
|
|
4
|
+
|
|
5
|
+
Commands are recorded as `client` spans within the trace of the current invocation.
|
|
6
|
+
|
|
7
|
+
Spans are named `{command} {collection}` and carry `db.*` attributes following the
|
|
8
|
+
[OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/database/mongodb/):
|
|
9
|
+
`db.system`, `db.namespace`, `db.collection.name`, `db.operation.name`.
|
|
10
|
+
|
|
11
|
+
Commands executed outside of a sampled trace context (e.g. index management on startup)
|
|
12
|
+
and internal driver commands (`hello`, `ping`, authentication) are not recorded.
|
|
13
|
+
|
|
14
|
+
Monitoring is client-side only and does not affect the MongoDB server. Span recording
|
|
15
|
+
adds no waiting to the query path: exporting is buffered and happens in the background.
|
|
16
|
+
|
|
17
|
+
## Stream tokens
|
|
18
|
+
|
|
19
|
+
A [stream](/documentation/collections.md) ends with a token of changes where two things hold:
|
|
20
|
+
|
|
21
|
+
- **MongoDB runs as a replica set**, which it does wherever there is an outbox.
|
|
22
|
+
- **The collection keeps images** of what a record was before each change, which is how a change
|
|
23
|
+
that takes an entry out of the collection is told from a change outside it. They cost a copy of every
|
|
24
|
+
changed record for as long as the oplog holds it, so a collection keeps them only by a
|
|
25
|
+
[migration](/documentation/component/declaration.md#migrations):
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
# migrations/0003-images.yaml
|
|
29
|
+
- images: true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`- images: false` stops keeping them, and a token issued before is then refused with `410`.
|
|
33
|
+
|
|
34
|
+
A token lasts as long as the oplog of the replica set holds the point it names — its window, which
|
|
35
|
+
the size of the oplog and the rate of writes decide.
|
|
36
|
+
|
|
37
|
+
A read from a token scans the oplog from the point it names: it costs what the whole replica set
|
|
38
|
+
wrote since, whatever of it concerns the collection.
|