Skip to content

Allow map() and filter() builtins on map values #575

Open
@antonmedv

Description

@antonmedv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions