You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But [for (myobj) . if ('.b', '.c.e')] would return an array[2,4] not an object.
I guess it's possible to use the Object for expressions to achieve filtering on the first level:
{for (myobj) .key : .value if .key == "b" }
but get's very cumbersome (or maybe I'm missing an obvious solution) when you want to select nested keys.
The obvious alternative to filter(myobj, ['.b', '.c.e'] is to write:
{
"b": .b,
"c": { "e": .c.e}
}
which is what I'm trying to avoid. I wanted a alternative syntax for this that is more concise just for the case when I'm selecting/dropping stuff without transforming the values.
Given the input :
I want the
filter(myobj, ['.b', '.c.e'])
to produce the outputNote that is this different from
[for (myobj) . if ('.b', '.c.e')]
that would produce an array[2, 4]
The text was updated successfully, but these errors were encountered: