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 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:

View File

@ -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",
}, },