@naturalcycles/db-lib 10.41.1 → 10.42.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.
@@ -386,6 +386,12 @@ export class CommonDao {
386
386
  }
387
387
  prepareSaveOptions(opt) {
388
388
  let { saveMethod, assignGeneratedIds = this.cfg.assignGeneratedIds, excludeFromIndexes = this.cfg.excludeFromIndexes, } = opt;
389
+ if (this.cfg.compress?.keys) {
390
+ excludeFromIndexes ??= [];
391
+ if (!excludeFromIndexes.includes('data')) {
392
+ excludeFromIndexes.push('data');
393
+ }
394
+ }
389
395
  if (this.cfg.immutable && !opt.allowMutability && !opt.saveMethod) {
390
396
  saveMethod = 'insert';
391
397
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/db-lib",
3
3
  "type": "module",
4
- "version": "10.41.1",
4
+ "version": "10.42.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@naturalcycles/nodejs-lib": "^15"
@@ -522,6 +522,14 @@ export class CommonDao<
522
522
  assignGeneratedIds = this.cfg.assignGeneratedIds,
523
523
  excludeFromIndexes = this.cfg.excludeFromIndexes,
524
524
  } = opt
525
+
526
+ if (this.cfg.compress?.keys) {
527
+ excludeFromIndexes ??= []
528
+ if (!excludeFromIndexes.includes('data' as any)) {
529
+ excludeFromIndexes.push('data' as any)
530
+ }
531
+ }
532
+
525
533
  if (this.cfg.immutable && !opt.allowMutability && !opt.saveMethod) {
526
534
  saveMethod = 'insert'
527
535
  }