mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Updating docs
This commit is contained in:
parent
78af68f436
commit
09c5ed24be
@ -1,4 +1,4 @@
|
||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.
|
||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.
|
||||
## Simple map navigation
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
@ -63,7 +63,7 @@ will output
|
||||
frog
|
||||
```
|
||||
|
||||
## Multiple special characters
|
||||
## Nested special characters
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
a:
|
||||
@ -230,8 +230,7 @@ will output
|
||||
## Traversing nested arrays by index
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
- []
|
||||
- - cat
|
||||
[[], [cat]]
|
||||
```
|
||||
then
|
||||
```bash
|
||||
|
@ -1 +1 @@
|
||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.
|
||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.
|
@ -78,7 +78,7 @@ var traversePathOperatorScenarios = []expressionScenario{
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Multiple special characters",
|
||||
description: "Nested special characters",
|
||||
document: `a: {"key.withdots": {"another.key": apple}}`,
|
||||
expression: `.a["key.withdots"]["another.key"]`,
|
||||
expected: []string{
|
||||
@ -253,9 +253,10 @@ var traversePathOperatorScenarios = []expressionScenario{
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Traversing nested arrays by index",
|
||||
document: `[[], [cat]]`,
|
||||
expression: `.[1][0]`,
|
||||
description: "Traversing nested arrays by index",
|
||||
dontFormatInputForDoc: true,
|
||||
document: `[[], [cat]]`,
|
||||
expression: `.[1][0]`,
|
||||
expected: []string{
|
||||
"D0, P[1 0], (!!str)::cat\n",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user