Commit 511ae70
committed
fix(ts): server-side batch import must wrap properties in a DataObject
The TypeScript server-side batching example passed bare objects ({ title })
to data.ingest(). Unlike data.insertMany(), data.ingest() does not treat a
bare object as properties on an untyped collection, so under auto-schema it
silently imported 5 objects with EMPTY properties (title dropped). Use the
DataObject wrapper ({ properties: { title } }) so the property persists, and
add a post-example fetchObjects() assertion that fails if the objects or
their titles are missing.1 parent 182965b commit 511ae70
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
355 | 363 | | |
356 | 364 | | |
357 | 365 | | |
| |||
0 commit comments