# dataset.listVersions()

**Added in:** `@mastra/core@1.4.0`

Lists all versions of the dataset with pagination.

## Usage example

```typescript
import { Mastra } from '@mastra/core'

const mastra = new Mastra({
  /* storage config */
})

const dataset = await mastra.datasets.get({ id: 'dataset-id' })

const { versions, pagination } = await dataset.listVersions({ page: 0, perPage: 10 })

for (const version of versions) {
  console.log(`Version ${version.version} created at ${version.createdAt}`)
}
```

## Parameters

**page** (`number`): Page number. Defaults to \`0\`.

**perPage** (`number`): Number of versions per page. Defaults to \`20\`.

## Returns

**result** (`Promise<object>`): Paginated version list.

**result.versions** (`DatasetVersion[]`): Array of version records.

**result.versions.id** (`string`): Unique identifier of the version record.

**result.versions.datasetId** (`string`): ID of the parent dataset.

**result.versions.version** (`number`): Version number.

**result.versions.createdAt** (`Date`): When this version was created.

**result.pagination** (`object`): Pagination metadata.

**result.pagination.total** (`number`): Total number of versions.

**result.pagination.page** (`number`): Current page number.

**result.pagination.perPage** (`number | false`): Versions per page, or \`false\` if unpaginated.

**result.pagination.hasMore** (`boolean`): Whether more pages are available.