which is very sleek and elegant. However, what would be even more convenient is
\ntweets | find(.Content contains \"Hello\") | .User\nIs there anything I'm missing to make this work?
\nThere's
\ntweets | find(.Content contains \"Hello\") | get(\"User\")\nbut now you're losing type-safety, I suppose.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"In Expr, pipes designed to always work with function. Expr parser checks if there is a function call after a pipe. This approach simplifies a lot of things and makes syntax consistent.
\nOne way to solve it is to use variables.
\nlet user = tweets | find(.Content contains \"Hello\"); \nuser.UserThe get built-in keep it's type information. It's a special built-in and have a special handling in type check.
-
|
One of the examples on the playground is which is very sleek and elegant. However, what would be even more convenient is Is there anything I'm missing to make this work? There's but now you're losing type-safety, I suppose. |
Beta Was this translation helpful? Give feedback.
-
|
In Expr, pipes designed to always work with function. Expr parser checks if there is a function call after a pipe. This approach simplifies a lot of things and makes syntax consistent. One way to solve it is to use variables. let user = tweets | find(.Content contains "Hello");
user.UserThe |
Beta Was this translation helpful? Give feedback.
In Expr, pipes designed to always work with function. Expr parser checks if there is a function call after a pipe. This approach simplifies a lot of things and makes syntax consistent.
One way to solve it is to use variables.
The
getbuilt-in keep it's type information. It's a special built-in and have a special handling in type check.