I'm using https://www.npmjs.com/package/keyv
I'm able to access individual items using key.get, but Im unable to iterator through all items. In the below piece of code, test is printed correctly, but im unable to access keyv.iterator.
async function testReadDB()
{
let keyv = new Keyv('sqlite://test.sqlite');
test = await keyv.get("test_key")
console.log(test)
try {
for (const [key, value] of keyv.iterator()) {
console.log(key, value);
};
}
catch (e) {
console.log(e.message)
}
}
Error: keyv.iterator is not a function or its return value is not iterable
Since
keyv.iterator()
returns anAsyncIterator
, it must be preceded byawait
: