Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
antonmedv opened this issue Feb 21, 2024 · 0 comments
Open

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

antonmedv opened this issue Feb 21, 2024 · 0 comments
Labels

Comments

@antonmedv
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant