Improving docs

This commit is contained in:
Mike Farah 2021-10-28 09:15:28 +11:00
parent d508ac3fa4
commit 65fd001575
2 changed files with 7 additions and 4 deletions

View File

@ -136,7 +136,9 @@ a:
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:
```yaml
a:

View File

@ -112,9 +112,10 @@ var assignOperatorScenarios = []expressionScenario{
},
},
{
description: "Update selected results",
document: `{a: {b: apple, c: cactus}}`,
expression: `(.a[] | select(. == "apple")) = "frog"`,
description: "Update deeply selected results",
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.",
document: `{a: {b: apple, c: cactus}}`,
expression: `(.a[] | select(. == "apple")) = "frog"`,
expected: []string{
"D0, P[], (doc)::{a: {b: frog, c: cactus}}\n",
},