items for filters
Given a record, iterate on each pair of column name and associated value.
Signature
> items {flags} (closure)
Parameters
-
closure: The closure to run.
Input/output types:
| input | output |
|---|---|
| record | any |
Examples
Iterate over each key-value pair of a record
> { new: york, san: francisco } | items {|key, value| echo $'($key) ($value)' }
╭───┬───────────────╮
│ 0 │ new york │
│ 1 │ san francisco │
╰───┴───────────────╯Notes
This is a fusion of columns, values and each.
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/items.html