expr icon indicating copy to clipboard operation
expr copied to clipboard

Allow `map()` and `filter()` builtins on map values

Open antonmedv opened this issue 2 years ago • 0 comments

Right now, only array & slices are supported. And we have builtins values() & keys(), toPairs() & fromPairs(). But they are difficult to work with.

Allow to use map values in map() and filter() (maybe something else?)

events 
| groupBy(.Author)
| filter(.Rating > 8.0)
| filter(#key != "") // #key is the .author here
| map(.Posts)
| flatten()
| sum(len(.Comments))

The pointer # is value and #key is key.

antonmedv avatar Feb 21 '24 19:02 antonmedv