redis-clear-lib
v1.0.7
Published
This library will help you clearing redis cache based on certain key
Downloads
7
Readme
This library will help you in setting up redeis server and help you in:
- Retrieving all keys based on input key
- Deleting all matching patterns/keys based on provided input
Install with:
npm install redis-clear-lib
let redisCache =require('redis-clear-lib')
- 1 Retrieving all keys based on input key
//
redisCache.getAllMatchingKeys('key').then(res=>{
// Arry containing list of keys
})
.catch(err=>{
//handling errors
})
- 2 Deleting all matching patterns/keys based on provided input
//
redisCache.deleteMatchingkeys('key').then(res=>{
//When the matching pattern is found
// {'success':true,'message':'Matching keys removed successfully','count':res};
//here count is number of matching keys
})
//handling errors
.catch(err=>{
//When no matching pattern is found
// {'success':false,'message':'No Matching pattern found'});
})