Copy as Markdown[View as Markdown](/docs/sdk/functions/rmDataStoreById.md)

***

# Function: rmDataStoreById()

> **rmDataStoreById**(`directory`): (`id`, `version`?, `persistFiles`?) => `Promise`<`void`>

Defined in: data-stores.ts:104

Delete an data store (e.g. database, cache, etc.) by its id.

Optionally specify a version to delete a specific version of the data store.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter       | Type      |
| --------------- | --------- |
| `id`            | `string`  |
| `version`?      | `string`  |
| `persistFiles`? | `boolean` |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

## Examples[​](#examples "Direct link to Examples")

```
import utils from '@eventcatalog/utils';

const { rmDataStoreById } = utils('/path/to/eventcatalog');

// deletes the latest orders-db data store
await rmDataStoreById('orders-db');

// deletes a specific version of the orders-db data store
await rmDataStoreById('orders-db', '0.0.1');
```

```
import utils from '@eventcatalog/utils';

const { rmContainerById } = utils('/path/to/eventcatalog');

// deletes the latest orders-db container
await rmContainerById('orders-db');

// deletes a specific version of the orders-db container
await rmContainerById('orders-db', '0.0.1');
```
