Methods
(static) get(params) → {Promise}
- Description:
Get Value (Stored as a String)
Example
await kv.get('hello');
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Key |
Returns:
- Type
- Promise
(static) get(params) → {Promise}
- Description:
Get Value (Stored as a Object)
Example
await ko.get('record');
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Key |
Returns:
- Type
- Promise
(static) incr(params, params, params) → {Promise}
- Description:
Increment
Example
var newValue = await incr('counter');
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Key |
params |
integer | Increment by |
params |
integer | Expire |
Returns:
- Type
- Promise
(static) keys() → {Promise}
- Description:
Key All Keys
Example
var allKeys = await keys();
Returns:
- Type
- Promise
(static) set(params, msg, ttl) → {Promise}
- Description:
Set Value (Stored as a String)
Example
await ko.set('record', {hello: 'world'});
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Key |
msg |
object | Value |
ttl |
integer | Value |
Returns:
- Type
- Promise
(static) set(params, msg, ttl) → {Promise}
- Description:
Set Value (Stored as a String)
Example
await kv.set('hello', 'world', 3600);
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Key |
msg |
string | Value |
ttl |
integer | Value |
Returns:
- Type
- Promise
(static) usage() → {Promise}
- Description:
Get Usage
Example
var currentUsage = await usage();
Returns:
- Type
- Promise