Update append array docs

This commit is contained in:
Mike Farah
2021-07-07 15:36:43 +10:00
parent ce3e347157
commit 542efd8928
2 changed files with 34 additions and 8 deletions
+26
View File
@@ -127,6 +127,32 @@ b:
- 4
```
## Append another array using +=
Given a sample.yml file of:
```yaml
a:
- 1
- 2
b:
- 3
- 4
```
then
```bash
yq eval '.a += .b' sample.yml
```
will output
```yaml
a:
- 1
- 2
- 3
- 4
b:
- 3
- 4
```
## Relative append
Given a sample.yml file of:
```yaml