Closed faustbrian closed 2 years ago
Been wondering what's the recommended way of getting a list of all keys in a database. I'm currently doing the following:
const result = []; for await (const [key, _] of database.iterator({ keys: true, values: false })) { result.push(key); } return result;
This feels a bit hacky. Is there any way to do this more efficiently or dump all keys at once?
const result = await db.keys().all()
Been wondering what's the recommended way of getting a list of all keys in a database. I'm currently doing the following:
This feels a bit hacky. Is there any way to do this more efficiently or dump all keys at once?