You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support sub-record keys and closures in group-by/sort-by #8322
How do i best sort a list of strings by length? I came up with:
echo [Steve,Alice,Charles, Bob] | each { |x| [[name,len]; [$x ,($x | str length)]] } | flatten | sort-by len | get name
but that's a bit unwieldy. Can sort-by somehow take a closure?
Activity
sholderbach commentedon Mar 6, 2023
Interesting point!
For reference to the interested parties. In the nushell code base the "sub-record keys" are referred to as "cell paths".
cablehead commentedon Mar 13, 2024
Noting additional interest in this issue, from the discord help channel
cablehead commentedon Apr 24, 2024
From Steve on discord:
Rework sorting and add cell path and closure comparators to `sort-by` (…
weirdan commentedon Feb 10, 2026
All the features requested here are already implemented (tested on 0.110.0).