2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: update
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
2019-10-03 13:24:28 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Update an existing column to have a new value.
|
2019-10-03 13:24:28 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
2019-10-03 13:24:28 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
```> update (field) (replacement value)```
|
2020-06-23 20:21:47 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Parameters
|
2019-10-03 13:24:28 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
- `field`: the name of the column to update
|
|
|
|
- `replacement value`: the new value to give the cell(s)
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Update a column value
|
2019-10-03 13:24:28 +02:00
|
|
|
```shell
|
2022-02-14 03:22:51 +01:00
|
|
|
> echo {'name': 'nu', 'stars': 5} | update name 'Nushell'
|
2020-06-23 20:21:47 +02:00
|
|
|
```
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Use in block form for more involved updating logic
|
2020-06-23 20:21:47 +02:00
|
|
|
```shell
|
2022-02-14 03:22:51 +01:00
|
|
|
> echo [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { get authors | str collect ',' }
|
2019-10-03 13:24:28 +02:00
|
|
|
```
|
2020-10-02 03:13:42 +02:00
|
|
|
|