new RedisCache(options)
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Accepts properties ["name", "redisOptions", "poolOptions", "logger"] Properties
|
Methods
deleteAll(pattern) → {array}
- Source:
Deletes all keys matching pattern
Parameters:
| Name | Type | Description |
|---|---|---|
pattern |
string | glob-style patterns/default '*' |
Returns:
The number of keys that were removed.
- Type
- array
get(key) → {string}
- Source:
Returns value or null when the key is missing
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | key for the value stored |
Returns:
value or null when the key is missing
- Type
- string
getName() → {string}
- Source:
Returns factory.name for this pool
Returns:
Name of the pool
- Type
- string
getPoolOptions() → {object}
- Source:
Returns this.poolOptions for this pool
Returns:
pool options given
- Type
- object
getRedisOptions() → {object}
- Source:
Returns this.redisOptions for this pool
Returns:
redis options given
- Type
- object
keys(pattern) → {array}
- Source:
Returns all keys matching pattern
Parameters:
| Name | Type | Description |
|---|---|---|
pattern |
string | glob-style patterns/default '*' |
Returns:
all keys matching pattern
- Type
- array
set(key, value, ttlInSeconds) → {string}
- Source:
Returns 'OK' if successful
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | key for the value stored |
value |
string | value to stored |
ttlInSeconds |
number | time to live in seconds |
Returns:
'OK' if successful
- Type
- string
status() → {object}
- Source:
Returns pool status and stats
Returns:
cache and its store status and stats
- Type
- object
wrap(key, promise, ttlInSeconds) → {string}
- Source:
Wraps promise to set its value if not exists.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | key for the value stored |
promise |
string | / value - value to stored |
ttlInSeconds |
number | time to live in seconds |
Returns:
'OK' if successful
- Type
- string