Add bulk delete
This commit is contained in:
parent
81af85eae0
commit
d06f9e0a1c
|
@ -327,6 +327,11 @@ class RedisWrapper {
|
||||||
await this.getClient().del(addDbPrefix(db, key))
|
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() {
|
async clear() {
|
||||||
let items = await this.scan()
|
let items = await this.scan()
|
||||||
await Promise.all(items.map((obj: any) => this.delete(obj.key)))
|
await Promise.all(items.map((obj: any) => this.delete(obj.key)))
|
||||||
|
|
Loading…
Reference in New Issue