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
Adding a in operator makes sense to me as well. Note that jq defines is as the inverse of has not contains (which is a little looser) - yq should do the same to maintain consistency.
Happy to take a PR for this - otherwise I'll get to it when I can :)
Please describe your feature request.
Inverse operator of
contains
, probably calledin
or something alike?Describe the solution you'd like
If we have data1.yml like:
(please keep to around 10 lines )
And we run a command:
yq 'filter(.type | in(["Tool", "Food"]))' data1.yml
it could output
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
yq 'filter(.type as $el | ["Tool", "Food"] | contains([$el]))' data1.yml
Additional context
jq
also has thein
operatorThe text was updated successfully, but these errors were encountered: