K/V Store Resource Node
The Key/Value Store Resource is a batteries-included, minimalist persistence layer for your app.
The store is a fully-managed, linearly scalable key-value storage system running on a distributed database. Keys must be strings, but values can be any JSON content.
Programmatic Access
Programmatic access to the key/value store is available in server-side runtimes, such as the TypeScript Server Resource and the Python Server Resource.
Example: TypeScript Server
await kv.set('example-key', { 'example value': 123 })await kv.get('example-key') // => returns { "example value": 123 }await kv.delete('example-key')
Properties
Keyspace
Prop | kvstoreNode.keyspace |
---|---|
Type | string |
Default | default |
The K/V store keyspace to use for all functions on this node. Specifying a keyspace introduces a prefix to all keys.
Actions
Get Key/Value Record
Gets a single record in the key/value store by key.
Parameter | Type | Default |
---|---|---|
key | string | `` |
select | string | `` |
Set Key/Value Record
Sets a single key/value record specified by key.
Parameter | Type | Default |
---|---|---|
key | string | `` |
value | string | `` |
select | string | `` |
List Records
Lists all key/value records.
Parameter | Type | Default |
---|---|---|
keys | string | `` |
select | string | `` |
List Keys
Lists all keys in the specified range.
Parameter | Type | Default |
---|---|---|
pattern | string | `` |
Delete Record
Deletes a single key/value record by key.
Parameter | Type | Default |
---|---|---|
key | string | `` |
Increment Field
Increments a numeric field on a specific key/value record.
Parameter | Type | Default |
---|---|---|
key | string | `` |
field | string | `` |
amount | string | 1 |
select | string | `` |
Decrement Field
Decrements a numeric field on a specific key/value record.
Parameter | Type | Default |
---|---|---|
key | string | `` |
field | string | `` |
amount | string | 1 |
select | string | `` |