mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
Improving docs
This commit is contained in:
parent
d508ac3fa4
commit
65fd001575
@ -136,7 +136,9 @@ a:
|
|||||||
b: frog
|
b: frog
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update selected results
|
## Update deeply selected results
|
||||||
|
Note that the LHS is wrapped in brackets! This is to ensure we dont first filter out the yaml and then update the snippet.
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
a:
|
a:
|
||||||
|
@ -112,9 +112,10 @@ var assignOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Update selected results",
|
description: "Update deeply selected results",
|
||||||
document: `{a: {b: apple, c: cactus}}`,
|
subdescription: "Note that the LHS is wrapped in brackets! This is to ensure we dont first filter out the yaml and then update the snippet.",
|
||||||
expression: `(.a[] | select(. == "apple")) = "frog"`,
|
document: `{a: {b: apple, c: cactus}}`,
|
||||||
|
expression: `(.a[] | select(. == "apple")) = "frog"`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
"D0, P[], (doc)::{a: {b: frog, c: cactus}}\n",
|
"D0, P[], (doc)::{a: {b: frog, c: cactus}}\n",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user