invalid input text "add" #1957
Unanswered
andy-maier
asked this question in
Q&A
Replies: 1 comment
-
I haven't yet added |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use the "add" filter to add the items in an array of integers, but that results in 'invalid input text "add"':
According to the jq documentation for "add", this ought to work: https://jqlang.github.io/jq/manual/#add
yq version: 4.35.2
jq version: 1.7
os: macos
shell: bash
Is this a bug?
How do I need to phrase the yq command so that the addition works?
Update:
After reading some more, it seems that the "yq" command simply does not support an "add" filter. Instead it supports the "+" operator. But the documentation has no example on how "+" can be used to add the integers in an array.
What I use right now, is:
This is pretty disappointing from a yq perspective, I would say. So if there is a yq-only solution, please post it here (and update the yq documentation with such an example).
Beta Was this translation helpful? Give feedback.
All reactions