@lossless.org/nosqldb 10.4.0 → 10.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lossless.org/nosqldb",
3
- "version": "10.4.0",
3
+ "version": "10.5.1",
4
4
  "private": false,
5
5
  "description": "A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.",
6
6
  "exports": {
@@ -14,12 +14,12 @@
14
14
  "devDependencies": {
15
15
  "@api.global/typedserver": "^8.4.6",
16
16
  "@design.estate/dees-element": "^2.2.4",
17
- "@git.zone/tsbuild": "^4.5.0",
18
- "@git.zone/tsbundle": "^2.13.0",
17
+ "@git.zone/tsbuild": "^5.0.0",
18
+ "@git.zone/tsbundle": "^2.15.0",
19
19
  "@git.zone/tsrust": "^1.13.2",
20
- "@git.zone/tstest": "^6.1.1",
20
+ "@git.zone/tstest": "^6.2.0",
21
21
  "@lossless.org/client": "0.1.1",
22
- "@types/node": "26.5.1",
22
+ "@types/node": "26.6.1",
23
23
  "mongodb": "^7.5.0"
24
24
  },
25
25
  "dependencies": {
package/readme.md CHANGED
@@ -559,6 +559,17 @@ see the transaction snapshot plus its staged changes. Commit validates conflicts
559
559
  and publishes atomically; abort discards staged changes. Write conflicts report
560
560
  `WriteConflict` (112) with `TransientTransactionError`.
561
561
 
562
+ A staged write conflicts when it touches a document `_id` or a unique index key
563
+ that another transaction or statement wrote after this transaction's snapshot:
564
+ for example two transactions that both read a claim as absent and then insert
565
+ it under the same `_id`, or under distinct `_id`s with the same unique key.
566
+ Statements validate against the snapshot, so such a collision is reported when
567
+ the loser commits; nothing of the losing transaction is published. The driver's
568
+ `withTransaction` retries the transient error, and the retry observes the
569
+ winner. A key already visible in the transaction's snapshot is not a conflict:
570
+ inserting it fails the statement with `DuplicateKey` (11000), as outside a
571
+ transaction.
572
+
562
573
  Commit/abort outcomes and successful retryable statement results survive file
563
574
  storage restart. Duplicate commits replay their outcome; abort after commit
564
575
  reports `TransactionCommitted` (256), commit after abort reports
@@ -1325,6 +1336,12 @@ await collection.findOneAndReplace({ _id: id }, { name: 'Replaced' }, { returnDo
1325
1336
  { $currentDate: { lastModified: true } }
1326
1337
  ```
1327
1338
 
1339
+ Aggregation-pipeline updates are supported wherever the MongoDB driver accepts
1340
+ them (`updateOne`, `updateMany`, `findOneAndUpdate`, and upserts): the update
1341
+ may be an array of `$addFields`, `$set`, `$project`, `$unset`, `$replaceRoot`
1342
+ or `$replaceWith` stages, and any other stage is refused by name. The pipeline
1343
+ must produce exactly one document and cannot change `_id`.
1344
+
1328
1345
  ### Aggregation Pipeline
1329
1346
 
1330
1347
  ```typescript
@@ -1339,6 +1356,12 @@ const results = await collection.aggregate([
1339
1356
 
1340
1357
  **Supported stages:** `$match`, `$project`, `$group`, `$sort`, `$limit`, `$skip`, `$unwind`, `$lookup`, `$addFields`, `$count`, `$facet`, `$replaceRoot`, `$set`, `$unionWith`, `$out`, `$merge`
1341
1358
 
1359
+ **Supported expression operators:** `$eq`, `$and`, `$literal`, `$map`,
1360
+ `$objectToArray`, `$setEquals`, plus `$field` paths, `$$variable` references
1361
+ including `$$ROOT`, and documents or arrays of those. Every other operator is
1362
+ refused by name with `TypeMismatch` (code 14) before any document is read; the
1363
+ engine never treats an operator it cannot execute as a literal value.
1364
+
1342
1365
  `$lookup` supports the equality form and a bounded correlated pipeline form with
1343
1366
  `let`, an optional `$match` using `$expr`/`$and`/`$eq`, and an optional following
1344
1367
  `$limit`. Correlated string equality predicates can use a full-key or subset
@@ -1358,6 +1381,19 @@ is what lets `countDocuments(filter)` run against collections larger than it.
1358
1381
 
1359
1382
  **Group accumulators:** `$sum`, `$avg`, `$min`, `$max`, `$first`, `$last`, `$push`, `$addToSet`, `$count`
1360
1383
 
1384
+ `$group._id` accepts a literal (`null`, a number, a string), a `$field`
1385
+ reference, or a document of expressions: `{ _id: { owner: '$owner', repo:
1386
+ '$repo' } }` groups by the evaluated pair, one group per distinct composite
1387
+ key. Inside a composite `_id`, a member whose field is absent evaluates to
1388
+ `null` and stays part of the key, where MongoDB omits the member instead.
1389
+ Accumulator operands accept the same expression forms. A field reference
1390
+ resolves per document, and a missing field is not a value: `$sum`, `$avg`,
1391
+ `$min`, `$max`, `$push` and `$addToSet` skip it, while `$first` and `$last`
1392
+ record `null` for it. Every field beside `_id` must hold an accumulator
1393
+ document naming exactly one accumulator, such as `{ $sum: 1 }`, and an operator
1394
+ outside the two lists above is refused with `TypeMismatch` (code 14) when the
1395
+ stage is parsed.
1396
+
1361
1397
  ### Indexes
1362
1398
 
1363
1399
  ```typescript
@@ -1430,9 +1466,11 @@ Without a limit, exact counts continue to EOF. Hints, deadlines and empty-result
1430
1466
  shapes remain supported; signed BSON count overflow and resource exhaustion
1431
1467
  reject explicitly. Exact counts never substitute estimates, and transaction
1432
1468
  counts retain the snapshot admission limits described below.
1433
- Grouping accumulates one group at a time after an external sort; constant-key
1434
- groups stream directly. Group accumulator semantics follow the documented local
1435
- expression surface; this does not add the complete MongoDB aggregation language.
1469
+ Grouping accumulates one group at a time after an external sort over the group
1470
+ key; only keys with no field reference and no operator stream directly into a
1471
+ single group. Composite document keys sort and group like any other key. Group
1472
+ key and accumulator semantics follow the supported expression operators listed
1473
+ above; this does not add the complete MongoDB aggregation language.
1436
1474
  Unwind retains one input while expanding arrays across batches. Lookup scans
1437
1475
  bounded foreign pages or indexed candidates, then assembles one byte-bounded
1438
1476
  result document. Unindexed joins can still require repeated foreign scans.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@lossless.org/nosqldb',
6
- version: '10.4.0',
6
+ version: '10.5.1',
7
7
  description: 'A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.'
8
8
  }