> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TapCollection

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

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()

```ts theme={null}
delete(id): Promise<void>;
```

Resolves whether or not a document was there to remove.

#### Parameters

##### id

`string`

#### Returns

`Promise`\<`void`>

***

### get()

```ts theme={null}
get(id): Promise<T | null>;
```

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

#### Parameters

##### id

`string`

#### Returns

`Promise`\<`T` | `null`>

***

### list()

```ts theme={null}
list(options?): Promise<{
  cursor?: string;
  items: T & {
     id: string;
  }[];
}>;
```

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()

```ts theme={null}
put(id, document): Promise<void>;
```

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

#### Parameters

##### id

`string`

##### document

`T`

#### Returns

`Promise`\<`void`>
