method
RedisClient.unlink
): Promise<number>;
Asynchronously delete one or more keys
Like DEL, UNLINK removes the specified keys and ignores keys that don't exist. Unlike DEL, it reclaims the memory in a different thread, so it does not block. Use it when deleting large values or many keys.
@param keys
The keys to delete
@returns
Promise that resolves with the number of keys that were unlinked
await redis.set("key1", "Hello");
await redis.set("key2", "World");
const count = await redis.unlink("key1", "key2", "key3");
console.log(count); // 2Referenced types
type KeyLike = string | ArrayBufferView | Blob