yq/pkg/yqlib/doc/operators/headers/add.md
2022-01-22 16:12:59 +11:00

376 B

Add

Add behaves differently according to the type of the LHS:

  • arrays: concatenate
  • number scalars: arithmetic addition
  • string scalars: concatenate

Use += as append assign for things like increment. Note that .a += .x is equivalent to running .a = .a + .x.

Add is not (yet) supported for maps - however you can use merge * which will have a similar effect...