@keyv/mongo 6.0.0-alpha.2 → 6.0.0-alpha.3

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/dist/index.cjs CHANGED
@@ -512,7 +512,7 @@ var KeyvMongo = class extends import_hookified.Hookified {
512
512
  const namespaceValue = namespace ?? "";
513
513
  if (this._useGridFS) {
514
514
  const gridIterator = client.store.find({ "metadata.namespace": { $eq: namespaceValue } }).map(async (x) => {
515
- const prefixedKey = namespace ? `${namespace}:${x.filename}` : x.filename;
515
+ const prefixedKey = x.filename;
516
516
  const stream = client.bucket.openDownloadStream(x._id);
517
517
  const data = await new Promise((resolve) => {
518
518
  const resp = [];
@@ -532,8 +532,7 @@ var KeyvMongo = class extends import_hookified.Hookified {
532
532
  return;
533
533
  }
534
534
  const iterator = client.store.find({ namespace: { $eq: namespaceValue } }).map((x) => {
535
- const prefixedKey = namespace ? `${namespace}:${x.key}` : x.key;
536
- return [prefixedKey, x.value];
535
+ return [x.key, x.value];
537
536
  });
538
537
  yield* iterator;
539
538
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Hookified } from 'hookified';
2
- import Keyv, { KeyvStoreAdapter, StoredData } from 'keyv';
2
+ import Keyv, { KeyvStorageAdapter, StoredData } from 'keyv';
3
3
  import { GridFSBucket, Collection, Db, MongoClient, ReadPreference, MongoClientOptions } from 'mongodb';
4
4
 
5
5
  type Options = {
@@ -23,7 +23,7 @@ type KeyvMongoConnect = {
23
23
  * MongoDB storage adapter for Keyv.
24
24
  * Provides a persistent key-value store using MongoDB as the backend.
25
25
  */
26
- declare class KeyvMongo extends Hookified implements KeyvStoreAdapter {
26
+ declare class KeyvMongo extends Hookified implements KeyvStorageAdapter {
27
27
  /**
28
28
  * The MongoDB connection URI.
29
29
  * @default 'mongodb://127.0.0.1:27017'
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Hookified } from 'hookified';
2
- import Keyv, { KeyvStoreAdapter, StoredData } from 'keyv';
2
+ import Keyv, { KeyvStorageAdapter, StoredData } from 'keyv';
3
3
  import { GridFSBucket, Collection, Db, MongoClient, ReadPreference, MongoClientOptions } from 'mongodb';
4
4
 
5
5
  type Options = {
@@ -23,7 +23,7 @@ type KeyvMongoConnect = {
23
23
  * MongoDB storage adapter for Keyv.
24
24
  * Provides a persistent key-value store using MongoDB as the backend.
25
25
  */
26
- declare class KeyvMongo extends Hookified implements KeyvStoreAdapter {
26
+ declare class KeyvMongo extends Hookified implements KeyvStorageAdapter {
27
27
  /**
28
28
  * The MongoDB connection URI.
29
29
  * @default 'mongodb://127.0.0.1:27017'
package/dist/index.js CHANGED
@@ -479,7 +479,7 @@ var KeyvMongo = class extends Hookified {
479
479
  const namespaceValue = namespace ?? "";
480
480
  if (this._useGridFS) {
481
481
  const gridIterator = client.store.find({ "metadata.namespace": { $eq: namespaceValue } }).map(async (x) => {
482
- const prefixedKey = namespace ? `${namespace}:${x.filename}` : x.filename;
482
+ const prefixedKey = x.filename;
483
483
  const stream = client.bucket.openDownloadStream(x._id);
484
484
  const data = await new Promise((resolve) => {
485
485
  const resp = [];
@@ -499,8 +499,7 @@ var KeyvMongo = class extends Hookified {
499
499
  return;
500
500
  }
501
501
  const iterator = client.store.find({ namespace: { $eq: namespaceValue } }).map((x) => {
502
- const prefixedKey = namespace ? `${namespace}:${x.key}` : x.key;
503
- return [prefixedKey, x.value];
502
+ return [x.key, x.value];
504
503
  });
505
504
  yield* iterator;
506
505
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyv/mongo",
3
- "version": "6.0.0-alpha.2",
3
+ "version": "6.0.0-alpha.3",
4
4
  "description": "MongoDB storage adapter for Keyv",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -51,10 +51,10 @@
51
51
  "rimraf": "^6.1.2",
52
52
  "tsd": "^0.33.0",
53
53
  "vitest": "^4.0.16",
54
- "@keyv/test-suite": "^6.0.0-alpha.2"
54
+ "@keyv/test-suite": "^6.0.0-alpha.3"
55
55
  },
56
56
  "peerDependencies": {
57
- "keyv": "^6.0.0-alpha.2"
57
+ "keyv": "^6.0.0-alpha.3"
58
58
  },
59
59
  "tsd": {
60
60
  "directory": "test"