yq/pkg/yqlib/doc/operators/headers/add.md

11 lines
355 B
Markdown
Raw Normal View History

2021-11-03 02:54:09 +00:00
# Add
2020-11-24 02:07:19 +00:00
Add behaves differently according to the type of the LHS:
2021-11-03 02:54:09 +00:00
* arrays: concatenate
* number scalars: arithmetic addition
* string scalars: concatenate
2022-01-23 00:35:44 +00:00
* maps: shallow merge (use the multiply operator (`*`) to deeply merge)
2022-01-23 00:35:44 +00:00
Use `+=` as a relative append assign for things like increment. Note that `.a += .x` is equivalent to running `.a = .a + .x`.
2022-01-22 02:47:22 +00:00