mirror of
https://github.com/nushell/nushell
synced 2024-11-15 01:17:07 +00:00
c0a1d18e3d
* feat: update #4455, regenerate commands' docs * chore: update make_docs script
704 B
704 B
title | layout | version |
---|---|---|
update | command | 0.59.0 |
Update an existing column to have a new value.
Signature
> update (field) (replacement value)
Parameters
field
: the name of the column to updatereplacement value
: the new value to give the cell(s)
Examples
Update a column value
> echo {'name': 'nu', 'stars': 5} | update name 'Nushell'
Use in block form for more involved updating logic
> echo [[count fruit]; [1 'apple']] | update count {|f| $f.count + 1}
Use in block form for more involved updating logic
> echo [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { get authors | str collect ',' }