I'm using ioredis with express (nodejs) I know that there is a way to delete keys by pattern like this:
redis-cli KEYS "sample_pattern:*" | xargs redis-cli DEL
However, is there a way to do that using ioredis instead?
I'm using ioredis with express (nodejs) I know that there is a way to delete keys by pattern like this:
redis-cli KEYS "sample_pattern:*" | xargs redis-cli DEL
However, is there a way to do that using ioredis instead?
First select your keys by pattern, then remove them by del method.
const keys = await ioredis.keys('PATTERN:*');
await ioredis.del(keys);