|
|
|
|
|
by cube2222
1621 days ago
|
|
I've actually just gone ahead and added a way to do this - the zip function - in the v0.2.0 release. The relevant jql snippet to solve this in the general case now is: (pipe
(zip
(keys)
((keys)))
((keys)
(object
"key" (0)
"value" (1))))
It's not as terse as the jq equivalent - I'll probably add a way to create user-defined functions, so you can alias stuff like this to shorter forms - but that one will require more thought. |
|
Unfortunately my next issue is how do I iterate over an array of objects (like jq `.[]`)? I'm guessing it's maybe something to do with `range` but I don't know how many I have in order to fill in those indices and I can't do `(elem 0) ... (elem 1)` for the same reason.