diff --git a/memdown.js b/memdown.js index 9233a4f..c5c1de9 100644 --- a/memdown.js +++ b/memdown.js @@ -158,7 +158,8 @@ function MemDOWN () { snapshots: true, permanence: false, seek: true, - clear: true + clear: true, + getMany: true }) this._store = createRBT(ltgt.compare) @@ -211,6 +212,13 @@ MemDOWN.prototype._get = function (key, options, callback) { }) } +MemDOWN.prototype._getMany = function (keys, options, callback) { + this._nextTick(callback, null, keys.map((key) => { + const value = this._store.get(key) + return value === undefined || options.asBuffer ? value : value.toString() + })) +} + MemDOWN.prototype._del = function (key, options, callback) { this._store = this._store.remove(key) this._nextTick(callback) diff --git a/package.json b/package.json index 635afd6..62a8550 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "CONTRIBUTORS.md" ], "dependencies": { - "abstract-leveldown": "^7.0.0", + "abstract-leveldown": "^7.2.0", "buffer": "^6.0.3", "functional-red-black-tree": "^1.0.1", "inherits": "^2.0.1", diff --git a/test.js b/test.js index 639ec96..e60e914 100644 --- a/test.js +++ b/test.js @@ -14,8 +14,9 @@ const testCommon = suite.common({ return memdown() }, - // Opt-in to new clear() tests + // Opt-in to new tests clear: true, + getMany: true, // Opt-out of unsupported features createIfMissing: false,