> For the complete documentation index, see [llms.txt](https://mikefarah.gitbook.io/yq/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mikefarah.gitbook.io/yq/operators/map.md).

# Map

Maps values of an array. Use `map_values` to map values of an object.

## Map array

Given a sample.yml file of:

```yaml
- 1
- 2
- 3
```

then

```bash
yq 'map(. + 1)' sample.yml
```

will output

```yaml
- 2
- 3
- 4
```

## Map object values

Given a sample.yml file of:

```yaml
a: 1
b: 2
c: 3
```

then

```bash
yq 'map_values(. + 1)' sample.yml
```

will output

```yaml
a: 2
b: 3
c: 4
```
