Skip to content

Commit

Permalink
Add record to table example (nushell#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
AadamZ5 authored Apr 4, 2022
1 parent d27ba60 commit 570d9bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions book/types_of_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ Records hold key-value pairs, much like objects in JSON. As these can sometimes
╰──────┴─────╯
```

You can iterate over records by first transposing it into a table:
```
> echo {name: sam, rank: 10} | transpose key value
╭───┬──────┬───────╮
│ # │ key │ value │
├───┼──────┼───────┤
│ 0 │ name │ sam │
│ 1 │ rank │ 10 │
╰───┴──────┴───────╯
```

## Lists

Lists can hold more than one value. These can be simple values. They can also hold rows, and the combination of a list of records is often called a "table".
Expand Down

0 comments on commit 570d9bb

Please sign in to comment.