W3cubDocs

/Nushell

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)' }
╭───┬───────────────╮
0newyork
1sanfrancisco
╰───┴───────────────╯

Notes

This is a the fusion of columns, values and each.

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/items.html