> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1778-mysql-updates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: Dataset<R>

> TypeScript SDK reference

[weave](../) / Dataset

Dataset object with easy saving and automatic versioning

`Example`

```ts theme={null}
// Create a dataset
const dataset = new Dataset({
  id: 'grammar-dataset',
  rows: [
    { id: '0', sentence: "He no likes ice cream.", correction: "He doesn't like ice cream." },
    { id: '1', sentence: "She goed to the store.", correction: "She went to the store." },
    { id: '2', sentence: "They plays video games all day.", correction: "They play video games all day." }
  ]
})

// Access a specific example
const exampleLabel = dataset.getRow(2).sentence;

// Save the dataset
const ref = await dataset.save()
```

## Type parameters

| Name | Type                 |
| :--- | :------------------- |
| `R`  | extends `DatasetRow` |

## Hierarchy

* [`WeaveObject`](./WeaveObject)

  ↳ `Dataset`

## Table of contents

### Constructors

* [constructor](./Dataset#constructor)

### Properties

* [\_\_savedRef](./Dataset#__savedref)
* [rows](./Dataset#rows)

### Accessors

* [description](./Dataset#description)
* [length](./Dataset#length)
* [name](./Dataset#name)

### Methods

* [\[asyncIterator\]](./Dataset#\[asynciterator])
* [getRow](./Dataset#getrow)
* [save](./Dataset#save)
* [saveAttrs](./Dataset#saveattrs)

## Constructors

### constructor

• **new Dataset**\<`R`>(`parameters`): [`Dataset`](./Dataset)\<`R`>

#### Type parameters

| Name | Type                 |
| :--- | :------------------- |
| `R`  | extends `DatasetRow` |

#### Parameters

| Name         | Type                      |
| :----------- | :------------------------ |
| `parameters` | `DatasetParameters`\<`R`> |

#### Returns

[`Dataset`](./Dataset)\<`R`>

#### Overrides

[WeaveObject](./WeaveObject).[constructor](./WeaveObject#constructor)

#### Defined in

[dataset.ts:51](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L51)

## Properties

### \_\_savedRef

• `Optional` **\_\_savedRef**: `ObjectRef` | `Promise`\<`ObjectRef`>

#### Inherited from

[WeaveObject](./WeaveObject).[\_\_savedRef](./WeaveObject#__savedref)

#### Defined in

[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49)

***

### rows

• **rows**: `Table`\<`R`>

#### Defined in

[dataset.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L49)

## Accessors

### description

• `get` **description**(): `undefined` | `string`

#### Returns

`undefined` | `string`

#### Inherited from

WeaveObject.description

#### Defined in

[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76)

***

### length

• `get` **length**(): `number`

#### Returns

`number`

#### Defined in

[dataset.ts:64](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L64)

***

### name

• `get` **name**(): `string`

#### Returns

`string`

#### Inherited from

WeaveObject.name

#### Defined in

[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72)

## Methods

### \[asyncIterator]

▸ **\[asyncIterator]**(): `AsyncIterator`\<`any`, `any`, `undefined`>

#### Returns

`AsyncIterator`\<`any`, `any`, `undefined`>

#### Defined in

[dataset.ts:68](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L68)

***

### getRow

▸ **getRow**(`index`): `R`

#### Parameters

| Name    | Type     |
| :------ | :------- |
| `index` | `number` |

#### Returns

`R`

#### Defined in

[dataset.ts:74](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L74)

***

### save

▸ **save**(): `Promise`\<`ObjectRef`>

#### Returns

`Promise`\<`ObjectRef`>

#### Defined in

[dataset.ts:60](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L60)

***

### saveAttrs

▸ **saveAttrs**(): `Object`

#### Returns

`Object`

#### Inherited from

[WeaveObject](./WeaveObject).[saveAttrs](./WeaveObject#saveattrs)

#### Defined in

[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53)
