# Aggregator

**Kind:** Interface

Aggregators can be used to compute aggregates for cell values.

```js
import {aggregators} from '@airtable/blocks/models';

// To get a list of aggregators supported for a specific field:
const fieldAggregators = myField.availableAggregators;

// To compute the total attachment size of an attachment field:
const aggregator = aggregators.totalAttachmentSize;
const value = aggregator.aggregate(myRecords, myAttachmentField);
const valueAsString = aggregate.aggregateToString(myRecords, myAttachmentField);
```

## Properties

### `displayName`

Type: `string`

A user friendly name for this aggregator that can be displayed to users.

### `key`

Type: `AggregatorKey`

A unique key for this aggregator that can be used to identify it in code.

### `shortDisplayName`

Type: `string`

A short user friendly name for this aggregator that can be displayed to users.

## Methods

### `aggregate(records, field)`

Aggregates the value of `field` in each of `records` to produce a single value.

**Parameters:**
- `records` (`Array<Record>`)
- `field` (`Field`)

**Returns:** `unknown`

### `aggregateToString(records, field)`

Aggregates the value of `field` in each of `records` to produce a single value, formatted as a string.

**Parameters:**
- `records` (`Array<Record>`)
- `field` (`Field`)

**Returns:** `string`
