redis-scan
Scan redis keys with pattern and do something to them, Aliyun redis cluster is supported.
install
npm i shimo-redis-scan
usage
const RedisScan = const Ioredis = // All keys is optionalconst task = // pattern pattern: 'key:*' // redis client redis: // scan count per time size: 1000 // handler function which return promise { console if index > 10000 } // aliyun redis cluster aliyun: false taskstart
notes
- You need to make your own catch-error logic
- Your node.js version must support async function
- Cluster mode is only enabled in Aliyun redis cluster
License
MIT