Constructor
# new NodeCacheAdapter(optionsopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options |
Object
|
<optional> |
||
stdTTL |
number
|
<optional> |
60 | Default TTL (seconds) |
checkperiod |
number
|
<optional> |
120 | How often to check for expired keys (seconds) |
Methods
# async del(key) → {Promise.<boolean>}
Delete a specific key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
Promise.<boolean>
# async get(key, ctxopt) → {Promise.<*>}
Get a value by key and rehydrate into Entity instances (if context provided).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
string
|
||
ctx |
Object
|
<optional> |
|
repository |
Object
|
<optional> |
Repository with wrapEntity() |
entityClass |
function
|
<optional> |
Entity class constructor |
Promise.<*>
# async invalidatePrefix(prefix) → {Promise.<boolean>}
Invalidate all keys that start with the given prefix.
Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
string
|
Promise.<boolean>
# async set(key, value, ttlSecondsopt, ctxopt) → {Promise.<boolean>}
Set a value by key. Stores as-is (entities are kept intact).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
string
|
||
value |
*
|
||
ttlSeconds |
number
|
<optional> |
Optional TTL override (seconds) |
ctx |
Object
|
<optional> |
Unused for Node adapter |
Promise.<boolean>