mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Added append equals, merge append. Fixed creating numeric arrays
This commit is contained in:
@@ -2,3 +2,5 @@ Add behaves differently according to the type of the LHS:
|
||||
- arrays: concatenate
|
||||
- number scalars: arithmetic addition (soon)
|
||||
- string scalars: concatenate (soon)
|
||||
|
||||
Use `+=` as append assign for things like increment. `.a += .x` is equivalent to running `.a |= . + .x`.
|
||||
|
||||
@@ -2,6 +2,8 @@ Like the multiple operator in `jq`, depending on the operands, this multiply ope
|
||||
|
||||
Upcoming versions of `yq` will add support for other types of multiplication (numbers, strings).
|
||||
|
||||
To concatenate when merging objects, use the `*+` form (see examples below). This will recursively merge objects, appending arrays when it encounters them.
|
||||
|
||||
Note that when merging objects, this operator returns the merged object (not the parent). This will be clearer in the examples below.
|
||||
|
||||
## Merging files
|
||||
|
||||
Reference in New Issue
Block a user