@push.rocks/smartdb 5.5.2 → 5.6.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.
Binary file
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "00320ccbef2538dfa9fba1da65bb5db3b1874aef58eb85cdf40f8f29f4822578",
3
+ "binarySha256": "55347a7396635075da1027b20e2bbccff00424f012d2001c087c73ea7e6c414d",
4
4
  "buildInfo": {
5
5
  "projectName": "@push.rocks/smartdb",
6
- "projectVersion": "5.5.2",
7
- "gitCommit": "389db71389a45d42b0f205736ae52f55d593aeb3",
6
+ "projectVersion": "5.6.0",
7
+ "gitCommit": "f0db2bc4f73ea31fd63f912dc61036c914946fce",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-04T18:59:43.562Z",
9
+ "builtAt": "2026-09-05T12:44:09.182Z",
10
10
  "tsrustVersion": "1.10.4",
11
11
  "binary": "rustdb",
12
12
  "target": "linux_amd64"
Binary file
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "0efe48ad0d320b53e565e5ac16810bb8ca153b1d1c39cb86e971297e62931442",
3
+ "binarySha256": "14467960f6674176bc91a7237a471459a415b8e699c3202541e7850e389627f9",
4
4
  "buildInfo": {
5
5
  "projectName": "@push.rocks/smartdb",
6
- "projectVersion": "5.5.2",
7
- "gitCommit": "389db71389a45d42b0f205736ae52f55d593aeb3",
6
+ "projectVersion": "5.6.0",
7
+ "gitCommit": "f0db2bc4f73ea31fd63f912dc61036c914946fce",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-04T19:00:17.487Z",
9
+ "builtAt": "2026-09-05T12:44:47.197Z",
10
10
  "tsrustVersion": "1.10.4",
11
11
  "binary": "rustdb",
12
12
  "target": "linux_arm64"
Binary file
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "f309ef5182f62bd147bab7bfd39be556d1ec0fce1dede84b9c424f607fe0a8b5",
3
+ "binarySha256": "255233b261d637b0ef65245ba123672b4fb89393127e92647bde47a9da4d07d7",
4
4
  "buildInfo": {
5
5
  "projectName": "@push.rocks/smartdb",
6
- "projectVersion": "5.5.2",
7
- "gitCommit": "389db71389a45d42b0f205736ae52f55d593aeb3",
6
+ "projectVersion": "5.6.0",
7
+ "gitCommit": "f0db2bc4f73ea31fd63f912dc61036c914946fce",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-04T19:01:23.168Z",
9
+ "builtAt": "2026-09-05T12:45:49.186Z",
10
10
  "tsrustVersion": "1.10.4",
11
11
  "binary": "rustdb",
12
12
  "target": "macos_amd64"
Binary file
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "6935370ae83f20f3dfd5e8167b68c9a60c656c17f8839a9b16c05e4009c27797",
3
+ "binarySha256": "c90862d452ac29941a98e94649cdf255cf93fdc895a2c0be61aa1c82bf146bbe",
4
4
  "buildInfo": {
5
5
  "projectName": "@push.rocks/smartdb",
6
- "projectVersion": "5.5.2",
7
- "gitCommit": "389db71389a45d42b0f205736ae52f55d593aeb3",
6
+ "projectVersion": "5.6.0",
7
+ "gitCommit": "f0db2bc4f73ea31fd63f912dc61036c914946fce",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-04T19:02:04.202Z",
9
+ "builtAt": "2026-09-05T12:46:28.431Z",
10
10
  "tsrustVersion": "1.10.4",
11
11
  "binary": "rustdb",
12
12
  "target": "macos_arm64"
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartdb',
6
- version: '5.5.2',
6
+ version: '5.6.0',
7
7
  description: 'A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxxQkFBcUI7SUFDM0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFIQUFxSDtDQUNuSSxDQUFBIn0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartdb",
3
- "version": "5.5.2",
3
+ "version": "5.6.0",
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": {
package/readme.md CHANGED
@@ -869,6 +869,49 @@ validated no-op and index version `v: 2`. Unsupported options, including
869
869
  index in the request is created. TTL metadata is retained in the catalog;
870
870
  automatic TTL expiry is not implemented.
871
871
 
872
+ `find()` and collection `aggregate()` accept `hint` as an index name (including
873
+ `_id_`) or an exact ascending/descending key pattern. Key-pattern order matters;
874
+ if several indexes share a key pattern, use a name. The selected active scalar
875
+ index supplies every candidate, using safe full-key equality bounds or a full
876
+ scan of that index. The complete predicate still runs, and explicit sorting,
877
+ projection, skip, and limit retain their normal semantics. Index traversal uses
878
+ bounded pages under the namespace lock, so concurrent writes wait until the
879
+ hinted source read finishes. Unsorted results have no guaranteed BSON value order.
880
+
881
+ ```typescript
882
+ await collection.createIndex({ organizationId: 1, userId: 1 }, { name: 'organization_user' });
883
+ const page = await collection.find({ organizationId: 'org-1' }, {
884
+ hint: 'organization_user', sort: { userId: 1, _id: 1 }, skip: 20, limit: 10,
885
+ }).toArray();
886
+ const count = await collection.countDocuments({ organizationId: 'org-1' }, {
887
+ hint: 'organization_user',
888
+ });
889
+ ```
890
+
891
+ Unknown or quarantined indexes, malformed/ambiguous patterns, `$natural`, and
892
+ hints on missing collections or views fail explicitly. Forced multikey traversal
893
+ is unsupported and rejects; unhinted array queries keep their existing scan
894
+ behavior. Sparse hints intentionally exclude documents absent from that index,
895
+ including for empty filters and counts. A hint is never silently replaced by a
896
+ collection scan or another index.
897
+
898
+ Hinted transaction reads construct the selected index from the existing bounded
899
+ transaction snapshot plus buffered writes; they never fetch candidate documents
900
+ from live storage. Read-only aggregate source pipelines also use that transaction
901
+ view. Foreign-collection stages (`$lookup`, `$unionWith`) and writing stages
902
+ (`$out`, `$merge`), including stages inside `$facet`, reject within transactions.
903
+ Their existing nontransaction behavior is unchanged.
904
+
905
+ Finite count probes consisting of optional `$match`, optional `$skip`, positive
906
+ integer `$limit`, and `$count` (or the driver's equivalent constant-one `$group`)
907
+ stream candidates and stop when the limit is reached. They preserve hints,
908
+ deadlines, and empty-result shapes without materializing the matched set. Stage
909
+ dispatch, syntax, specifications, predicates, and streamed BSON processing consume
910
+ the same aggregation work budget as ordinary pipelines. This permits bounded namespace inspection of collections larger
911
+ than 10,000 documents or 32 MiB. Generic pipelines retain their existing
912
+ materialization limits. Transactions still require the existing bounded base
913
+ snapshot; finite counts do not bypass its 10,000-document / 32 MiB admission cap.
914
+
872
915
  ### Database & Admin
873
916
 
874
917
  ```typescript
package/readme.plan.md ADDED
@@ -0,0 +1,9 @@
1
+ # Query hints and finite counts
2
+
3
+ Find and aggregate select the requested active scalar index by name or exact numeric key pattern. Candidate pages have count and byte bounds; full predicates, explicit sorting, projection, skip, limit, deadlines, and cursor limits remain authoritative. Unknown, malformed, ambiguous, natural-order, and multikey hints reject explicitly. Sparse hints retain sparse membership semantics.
4
+
5
+ Transaction source reads use the owned snapshot plus buffered writes. Foreign-reading and writing aggregate stages reject inside transactions, including nested facets. Their nontransaction behavior is preserved.
6
+
7
+ Finite count pipelines support optional match, optional skip, positive integer limit, and count or the driver's constant-one count group. The query engine owns streaming accumulation and shares the normal aggregation work ceiling for stage dispatch, syntax, specifications, predicates, and BSON payload processing. Physical traversal preserves hints and deadlines. Generic materialization limits and the existing transaction snapshot admission cap of 10,000 documents / 32 MiB remain.
8
+
9
+ Regression coverage includes competing sparse/dense indexes, SCIM compound keys, candidate page count/byte boundaries, malformed hints, buffered transactions, foreign-stage rejection, 12,000-document finite probes, sources exceeding 32 MiB, retained resource caps, and shared aggregation work-budget enforcement.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartdb',
6
- version: '5.5.2',
6
+ version: '5.6.0',
7
7
  description: 'A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.'
8
8
  }