compact for filters> compact {flags} ...rest
...rest: the columns to compact from the table| input | output | 
|---|---|
| list<any> | list<any> | 
| table | table | 
Filter out all records where 'Hello' is null (returns nothing)
> [["Hello""World"]; [null3]] |compactHello
╭────────────╮
│emptylist│
╰────────────╯
Filter out all records where 'World' is null (Returns the table)
> [["Hello""World"]; [null3]] |compactWorld
╭───┬───────┬───────╮
│# │ Hello │ World │
├───┼───────┼───────┤
│0││3│
╰───┴───────┴───────╯
Filter out all instances of nothing from a list (Returns [1,2])
> [1, null, 2] |compact
╭───┬───╮
│0│1│
│1│2│
╰───┴───╯
    Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
    https://www.nushell.sh/commands/docs/compact.html