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

***

# Function: dataStoreHasVersion()

> **dataStoreHasVersion**(`directory`): (`id`, `version`?) => `Promise`<`boolean`>

Defined in: data-stores.ts:122

Check to see if the catalog has a version for the given data store (e.g. database, cache, etc.).

## 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` |

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

`Promise`<`boolean`>

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

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

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

// returns true if version is found for the given data store and version (supports semver)
await dataStoreHasVersion('orders-db', '0.0.1');
await dataStoreHasVersion('orders-db', 'latest');
await dataStoreHasVersion('orders-db', '0.0.x');
```

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

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

// returns true if version is found for the given entity and version (supports semver)
await containerHasVersion('orders-db', '0.0.1');
await containerHasVersion('orders-db', 'latest');
await containerHasVersion('orders-db', '0.0.x');
```
