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
Let's say we have a list of list and want to select the sublist where a string starts with a letter.
So, given the JSON
[
[
"ab",
"cd"
],
[
"ef",
"gh"
]
]
One could do:
[?contains([].starts_with(@, `a`), `true`)]
But, in order to have a consistent notation, I was trying to make the contains function a dot notation too, so:
[?[].starts_with(@, `a`).contains(@, `true`)]
which does not work.
I figured out it as because starts_with returns a projection, so it can be achieved resetting it:
[?[].starts_with(@, `a`) | contains(@, `true`)]
But I feel, for a new comer that does not know that well about projections and resetting them, it should be explained in the specification in more details, shouldn't it?
The text was updated successfully, but these errors were encountered:
Let's say we have a list of list and want to select the sublist where a string starts with a letter.
So, given the JSON
One could do:
But, in order to have a consistent notation, I was trying to make the
contains
function a dot notation too, so:which does not work.
I figured out it as because
starts_with
returns a projection, so it can be achieved resetting it:But I feel, for a new comer that does not know that well about projections and resetting them, it should be explained in the specification in more details, shouldn't it?
The text was updated successfully, but these errors were encountered: