1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

Add bulk delete

This commit is contained in:
Adria Navarro 2024-03-07 00:25:12 +01:00
parent 81af85eae0
commit d06f9e0a1c

View file

@ -327,6 +327,11 @@ class RedisWrapper {
await this.getClient().del(addDbPrefix(db, key))
}
async bulkDelete(keys: string[]) {
const db = this._db
await this.getClient().del(keys.map(key => addDbPrefix(db, key)))
}
async clear() {
let items = await this.scan()
await Promise.all(items.map((obj: any) => this.delete(obj.key)))