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

Propkeyspace
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
keystringundefined
selectstringundefined

Set Key/Value Record

Sets a single key/value record specified by key.

ParameterTypeDefault
keystringundefined
valueunknownundefined
selectstringundefined

List Records

Lists all key/value records.

ParameterTypeDefault
keysstringundefined
selectstringundefined

List Keys

Lists all keys in the specified range.

ParameterTypeDefault
patternstringundefined

Delete Record

Deletes a single key/value record by key.

ParameterTypeDefault
keystringundefined

Increment Field

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

ParameterTypeDefault
keystringundefined
fieldstringundefined
amountstring1
selectstringundefined

Decrement Field

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

ParameterTypeDefault
keystringundefined
fieldstringundefined
amountstring1
selectstringundefined