Skip to main content
The handle tap.storage.<name> exposes for an id-keyed collection, which holds many documents under ids you choose.

Remarks

A collection is id-keyed when the manifest leaves singleton off. Every call needs the storage:write scope, list and get included.

Type Parameters

T

T

Methods

delete()

Resolves whether or not a document was there to remove.

Parameters

id
string

Returns

Promise<void>

get()

Resolves to null when the collection holds no document under that id.

Parameters

id
string

Returns

Promise<T | null>

list()

Pass the cursor a previous page answered with to read the next one.

Parameters

options?
cursor?
string
limit?
number

Returns

Promise<{ cursor?: string; items: T & { id: string; }[]; }>

put()

Writes the document under that id, replacing any document already there.

Parameters

id
string
document
T

Returns

Promise<void>