---
title: KVStore
slug: data-platform/connect-platform/app-sdk-api-reference-interfaces-kvstore
docTags: 
createdAt: 2026-08-05T20:06:34.295Z
---

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT)

***

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT) / KVStore

# Interface: KVStore

Defined in: [src/store/KVStore.ts:46](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L46)

The base interface all key-value stores implement

## Extends

- [`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf)\<[`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh), [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)>

## Methods

### addNumber()

:::BlockQuote
**addNumber**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:240](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L240)

Atomically adds a value to a NumberSet. If the object or field does not exist, it will be created with a NumberSet
containing the given element. If the field exists but is not a NumberSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the NumberSet

### value

`number`

to add

### Returns

`Promise`\<`boolean`>

`true` if the value was newly added, `false` if it was already a member of the set

***

### addNumberMulti()

:::BlockQuote
**addNumberMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>
:::

Defined in: [src/store/KVStore.ts:251](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L251)

Atomically adds the given arrays of values to the given NumberSet fields. If the object or fields do not exist,
they will be created from the given arrays. If any field exists but is not a NumberSet, this will result in an
error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`\[]>

hash of fields to array of values to add

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>

hash of fields to NumberSet containing only the values that were newly added (any values that already
existed in the target NumberSet will not exist in the return value)

***

### addString()

:::BlockQuote
**addString**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:305](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L305)

Atomically adds a value to a StringSet. If the object or field does not exist, it will be created with a StringSet
containing the given element. If the field exists but is not a StringSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the StringSet

### value

`string`

to add

### Returns

`Promise`\<`boolean`>

`true` if the value was newly added, `false` if it was already a member of the set

***

### addStringMulti()

:::BlockQuote
**addStringMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>
:::

Defined in: [src/store/KVStore.ts:316](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L316)

Atomically adds the given arrays of values to the given StringSet fields. If the object or fields do not exist,
they will be created from the given arrays. If any field exists but is not a StringSet, this will result in an
error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`string`\[]>

hash of fields to array of values to add

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>

hash of fields to StringSet containing only the values that were newly added (any values that already
existed in the target StringSet will not exist in the return value)

***

### append()

:::BlockQuote
**append**\<`T`>(`key`, `field`, `value`): `Promise`\<`void`>
:::

Defined in: [src/store/KVStore.ts:216](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L216)

Atomically append an element to the *end* of a list. If the object or field does not exist, it will be created
with a list consisting of the given element. If the field exists but is not a list, this will result in an error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the list

### value

`T`

to append

### Returns

`Promise`\<`void`>

### Async

***

### appendMulti()

:::BlockQuote
**appendMulti**\<`T`>(`key`, `fieldValues`): `Promise`\<`void`>
:::

Defined in: [src/store/KVStore.ts:226](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L226)

Atomically append the given arrays of elements to the *end* of the given lists. If the object or fields do not
exist, they will be created from the given arrays. If any field exists but is not a list, this will result in an
error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>

hash of fields to array of values to append

### Returns

`Promise`\<`void`>

### Async

***

### delete()

:::BlockQuote
**delete**\<`T`>(`key`, `fields?`): `Promise`\<`T`>
:::

Defined in: [src/store/KVStore.ts:102](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L102)

Delete an object or a single field from the store at a given key.
If fields is undefined, the entire object will be deleted.

### Type Parameters

### T

`T` *extends* [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)

### Parameters

### key

`string`

of the stored object

### fields?

`string`\[]

to delete or undefined to delete all fields

### Returns

`Promise`\<`T`>

the deleted value if successful, or an empty object if it did not exist.

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `delete` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

***

### exists()

:::BlockQuote
**exists**(`key`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:110](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L110)

Check if an object exists at a given key.

### Parameters

### key

`string`

of the stored object

### Returns

`Promise`\<`boolean`>

true if the object exists

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `exists` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

***

### get()

:::BlockQuote
**get**\<`T`>(`key`, `fields?`): `Promise`\<`T`>
:::

Defined in: [src/store/KVStore.ts:59](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L59)

Retrieve an object from the store given a key.

### Type Parameters

### T

`T` *extends* [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)

### Parameters

### key

`string`

of the stored object

### fields?

`string`\[]

to retrieve from the stored object, or undefined to retrieve the full object

### Returns

`Promise`\<`T`>

hash of the complete object or only the specified fields, if supplied.
An empty object is returned if the object, or all specified fields, does not exist.

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `get` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

***

### hasNumber()

:::BlockQuote
**hasNumber**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:282](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L282)

Checks if a value exists in a NumberSet. Calling this method on a non-existent object will not cause it to be
created. If the field exists but is not a NumberSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the NumberSet

### value

`number`

to check

### Returns

`Promise`\<`boolean`>

`true` if the value is a member of the set, `false` if it is not

***

### hasNumberMulti()

:::BlockQuote
**hasNumberMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>
:::

Defined in: [src/store/KVStore.ts:291](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L291)

Checks if the given arrays of values exist in the given NumberSet fields. Calling this method on a non-existent
object will not cause it to be created. If any field exists but is not a NumberSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`\[]>

hash of fields to array of values to check

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>

hash of fields to NumberSet containing only the values that exist in the target NumberSet

***

### hasString()

:::BlockQuote
**hasString**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:347](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L347)

Checks if a value exists in a StringSet. Calling this method on a non-existent object will not cause it to be
created. If the field exists but is not a StringSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the StringSet

### value

`string`

to check

### Returns

`Promise`\<`boolean`>

`true` if the value is a member of the set, `false` if it is not

***

### hasStringMulti()

:::BlockQuote
**hasStringMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>
:::

Defined in: [src/store/KVStore.ts:356](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L356)

Checks if the given arrays of values exist in the given StringSet fields. Calling this method on a non-existent
object will not cause it to be created. If any field exists but is not a StringSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`string`\[]>

hash of fields to array of values to check

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>

hash of fields to StringSet containing only the values that exist in the target StringSet

***

### increment()

:::BlockQuote
**increment**(`key`, `field`, `amount?`, `options?`): `Promise`\<`number`>
:::

Defined in: [src/store/KVStore.ts:127](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L127)

Atomically increment the value of a numeric field. If the object or field did not previously exist, the resulting
field will be set to the given amount. If the field does already exist but is not a number, this will result in
an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

to increment

### amount?

`number`

by which to increment (can be negative, defaults to 1)

### options?

[`` `KVRowOptions` ``](docId:93uykz4TJlXsqyfOT-uVp)

optionally set a TTL for this row

### Returns

`Promise`\<`number`>

the value of the field after incrementing

### Async

***

### incrementMulti()

:::BlockQuote
**incrementMulti**(`key`, `fieldAmounts`, `options?`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`>>
:::

Defined in: [src/store/KVStore.ts:139](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L139)

Atomically increment the values of multiple numeric fields. If the object or fields did not previously exist, the
resulting fields will be set to their respective given amount. If any of the fields does already exist but is not a
number, this will result in an error.

### Parameters

### key

`string`

of the stored object

### fieldAmounts

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`>

hash of fields to amounts by which to increment (can be negative)

### options?

[`` `KVRowOptions` ``](docId:93uykz4TJlXsqyfOT-uVp)

optionally set a TTL for this row

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`>>

hash of fields to values after incrementing

### Async

***

### patch()

### Call Signature

:::BlockQuote
**patch**\<`T`>(`key`, `value`, `options?`): `Promise`\<`T`>
:::

Defined in: [src/store/KVStore.ts:80](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L80)

Write a set of fields to an object in the store at a given key. Does not overwrite the entire object.

### Type Parameters

### T

`T` *extends* [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)

### Parameters

### key

`string`

of the stored object

### value

`T`

hash of fields and values to update the object with. Leaves all other fields untouched.

### options?

[`` `KVRowOptions` ``](docId:93uykz4TJlXsqyfOT-uVp)

optionally set a TTL for this row

### Returns

`Promise`\<`T`>

the complete object from before the update
An empty object is returned if the object previously did not exist.

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `patch` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

### Call Signature

:::BlockQuote
**patch**\<`T`>(`key`, `updater`, `options?`): `Promise`\<`T`>
:::

Defined in: [src/store/KVStore.ts:92](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L92)

Update a stored object using a callback to make changes.

### Type Parameters

### T

`T` *extends* [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)

### Parameters

### key

`string`

of the stored object

### updater

[`` `KVPatchUpdater` ``](docId\:bu1eGuo4fyCoNExSlonQr)\<`T`>

function to manipulate the existing object (may be called multiple times to ensure an atomic change)

### options?

[`` `KVRowOptions` ``](docId:93uykz4TJlXsqyfOT-uVp)

optionally set a TTL for this row

### Returns

`Promise`\<`T`>

the complete object from before the update
An empty object is returned if the object previously did not exist.

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `patch` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

***

### peek()

:::BlockQuote
**peek**\<`T`>(`key`, `field`): `Promise`\<`undefined` | `T`>
:::

Defined in: [src/store/KVStore.ts:196](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L196)

Retrieve (without removing) the first element from a list. If the object or field does not exist, is empty, or is
not a list, the result will be `undefined`.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the list

### Returns

`Promise`\<`undefined` | `T`>

the first element of the list, if available, otherwise `undefined`

### Async

***

### peekMulti()

:::BlockQuote
**peekMulti**\<`T`>(`key`, `fieldCounts`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>>
:::

Defined in: [src/store/KVStore.ts:206](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L206)

Retrieve (without removing) *up to* the given number of elements from the *front* of the given lists. If the object
or fields do not exist, are empty, or are not lists, the result of each missing field will be an empty array.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### fieldCounts

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`>

hash of fields to number of elements to retrieve

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>>

hash of fields to array of list elements

### Async

***

### put()

:::BlockQuote
**put**\<`T`>(`key`, `value`, `options?`): `Promise`\<`T`>
:::

Defined in: [src/store/KVStore.ts:69](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L69)

Write an object to the store at a given key. Overwrites the entire object.

### Type Parameters

### T

`T` *extends* [`` `KVHash` ``](docId:95L1g7786cTa-PijLiwGh)

### Parameters

### key

`string`

of the stored object

### value

`T`

complete hash to write

### options?

[`` `KVRowOptions` ``](docId:93uykz4TJlXsqyfOT-uVp)

optionally set a TTL for this row

### Returns

`Promise`\<`T`>

the previous value found at the key if successful. Otherwise throws an error.

### Async

### Overrides

[`` `BaseKVStore` ``](docId\:BZwGjKkAkgpNuWYoCMZLf).[`` `put` ``](docId\:Fg0htEGqcx00Vcvflv-lB)

***

### removeNumber()

:::BlockQuote
**removeNumber**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:261](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L261)

Atomically removes a value from a NumberSet. Calling this method on a non-existent object will not cause it to
be created. If the field exists but is not a NumberSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the NumberSet

### value

`number`

to remove

### Returns

`Promise`\<`boolean`>

`true` if the value was removed, `false` if it was not a member of the set

***

### removeNumberMulti()

:::BlockQuote
**removeNumberMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>
:::

Defined in: [src/store/KVStore.ts:272](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L272)

Atomically removes the given arrays of values from the given NumberSet fields. Calling this method on a
non-existent object will not cause it to be created. If any field exists but is not a NumberSet, this will result
in an error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`\[]>

hash of fields to array of values to remove

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `NumberSet` ``](docId\:SisAMkfH6UTSrOrrjp8r0)>>

hash of fields to NumberSet containing only the values that were removed (any values that did not exist in
the target NumberSet will not exist in the return value)

***

### removeString()

:::BlockQuote
**removeString**(`key`, `field`, `value`): `Promise`\<`boolean`>
:::

Defined in: [src/store/KVStore.ts:326](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L326)

Atomically removes a value from a StringSet. Calling this method on a non-existent object will not cause it to
be created. If the field exists but is not a StringSet, this will result in an error.

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the StringSet

### value

`string`

to remove

### Returns

`Promise`\<`boolean`>

`true` if the value was removed, `false` if it was not a member of the set

***

### removeStringMulti()

:::BlockQuote
**removeStringMulti**(`key`, `fieldValues`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>
:::

Defined in: [src/store/KVStore.ts:337](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L337)

Atomically removes the given arrays of values from the given StringSet fields. Calling this method on a
non-existent object will not cause it to be created. If any field exists but is not a StringSet, this will result
in an error.

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`string`\[]>

hash of fields to array of values to remove

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<[`` `StringSet` ``](docId\:BJadiYMyQH_K_LM50rPZe)>>

hash of fields to StringSet containing only the values that were removed (any values that did not exist in
the target StringSet will not exist in the return value)

***

### shift()

:::BlockQuote
**shift**\<`T`>(`key`, `field`): `Promise`\<`undefined` | `T`>
:::

Defined in: [src/store/KVStore.ts:154](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L154)

Atomically retrieve and remove the *first* element from a list. If the object or field does not exist or is empty,
the result will be `undefined`. Calling this method on a non-existent object will not cause it to be created. If
the field exists but is not a list, this will result in an error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the list

### Returns

`Promise`\<`undefined` | `T`>

the first element of the list, if available, otherwise `undefined`

### Async

***

### shiftMulti()

:::BlockQuote
**shiftMulti**\<`T`>(`key`, `fieldCounts`): `Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>>
:::

Defined in: [src/store/KVStore.ts:166](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L166)

Atomically retrieve and remove *up to* the given number of elements from the *front* of the given lists. If the
object or fields do not exist or are empty, the result of each missing field will be an empty array. Calling this
method on a non-existent object will not cause it to be created. If any field exists but is not a list, this will
result in an error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### fieldCounts

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`number`>

hash of fields to number of elements to retrieve and remove

### Returns

`Promise`\<[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>>

hash of fields to array of list elements

### Async

***

### unshift()

:::BlockQuote
**unshift**\<`T`>(`key`, `field`, `value`): `Promise`\<`void`>
:::

Defined in: [src/store/KVStore.ts:176](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L176)

Atomically insert an element at the *front* of a list. If the object or field does not exist, it will be created
with a list consisting of the given element. If the field exists but is not a list, this will result in an error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### field

`string`

that holds the list

### value

`T`

to insert

### Returns

`Promise`\<`void`>

### Async

***

### unshiftMulti()

:::BlockQuote
**unshiftMulti**\<`T`>(`key`, `fieldValues`): `Promise`\<`void`>
:::

Defined in: [src/store/KVStore.ts:186](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/KVStore.ts#L186)

Atomically insert the given arrays of elements at the *front* of the given lists. If the object or fields do not
exist, they will be created from the given arrays. If any field exists but is not a list, this will result in an
error.

### Type Parameters

### T

`T` *extends* [`` `Value` ``](docId\:Y8SgTH0P-7HSO9dfjQbVx)

### Parameters

### key

`string`

of the stored object

### fieldValues

[`` `MultiValue` ``](docId\:cBmAXxpce9u4Z_c3-78VQ)\<`T`\[]>

hash of fields to array of values to insert

### Returns

`Promise`\<`void`>

### Async
