Not able to select fields
james64 opened this issue · comments
Jakub Dubovsky commented
I am "reporting" this only as feedback of why I am not trying to use rq after initial try. I am unable to do this trivial "select" transformation:
{ "a" : 1, "b" : 2, "c" : 3} -> ... -> { "a" : 1, "c" : 3}
Either it is not supported or it is very weirdly named and I cannot find it. I tend to think it is the latter because this is so basic operation that it is hard to imagine it missing.
Jon de la Motte commented
I think you're probably looking for map
which is used like so:
$ echo '{"a" : 1, "b" : 2, "c" : 3}' | rq 'map(({a, c}) => ({a, c}))'
{
"a": 1,
"c": 3
}
David Flemström commented
I have since removed Javascript support from rq, it might be added back some time in the future!