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

PropkvstoreNode.keyspace
Typestring
Defaultdefault

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.

ParameterTypeDefault
keystring``
selectstring``

Set Key/Value Record

Sets a single key/value record specified by key.

ParameterTypeDefault
keystring``
valuestring``
selectstring``

List Records

Lists all key/value records.

ParameterTypeDefault
keysstring``
selectstring``

List Keys

Lists all keys in the specified range.

ParameterTypeDefault
patternstring``

Delete Record

Deletes a single key/value record by key.

ParameterTypeDefault
keystring``

Increment Field

Increments a numeric field on a specific key/value record.

ParameterTypeDefault
keystring``
fieldstring``
amountstring1
selectstring``

Decrement Field

Decrements a numeric field on a specific key/value record.

ParameterTypeDefault
keystring``
fieldstring``
amountstring1
selectstring``