default
for filters
Sets a default row's column if missing.
Signature
> default (default value) (column name)
Parameters
default value
: the value to use as a defaultcolumn name
: the name of the column
Examples
Give a default 'target' column to all file entries
> ls -la | default 'nothing' target
Get the env value of MY_ENV
with a default value 'abc' if not present
> $env | get -i MY_ENV | default 'abc'
Replace the null
value in a list
> [1, 2, null, 4] | default 3
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
│ 3 │ 4 │
╰───┴───╯