mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Fixed delete full path
This commit is contained in:
@@ -14,6 +14,23 @@ will output
|
||||
a: cat
|
||||
```
|
||||
|
||||
## Delete nested entry in map
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
a:
|
||||
a1: fred
|
||||
a2: frood
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval 'del(.a.a1)' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
a:
|
||||
a2: frood
|
||||
```
|
||||
|
||||
## Delete entry in array
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
@@ -31,6 +48,21 @@ will output
|
||||
- 3
|
||||
```
|
||||
|
||||
## Delete nested entry in array
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
- a: cat
|
||||
b: dog
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval 'del(.[0].a)' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
- b: dog
|
||||
```
|
||||
|
||||
## Delete no matches
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
|
||||
Reference in New Issue
Block a user