mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Task: Add docs on keys with dots
Adds documentation on how to use a key lookup indicator for dealing with keys that have dots when specifying a path as part of create, read, and write commands. Resolves: #22
This commit is contained in:
@@ -39,4 +39,6 @@ You can also pipe the instructions in:
|
||||
|
||||
```bash
|
||||
cat create_instructions.yaml | yaml n -s -
|
||||
```
|
||||
```
|
||||
|
||||
{!snippets/keys_with_dots.md!}
|
||||
|
||||
@@ -91,3 +91,5 @@ will output:
|
||||
- fred
|
||||
- sam
|
||||
```
|
||||
|
||||
{!snippets/keys_with_dots.md!}
|
||||
|
||||
17
mkdocs/snippets/keys_with_dots.md
Normal file
17
mkdocs/snippets/keys_with_dots.md
Normal file
@@ -0,0 +1,17 @@
|
||||
### Keys with dots
|
||||
When specifying a key that has a dot use key lookup indicator.
|
||||
|
||||
```yaml
|
||||
b:
|
||||
foo.bar: 7
|
||||
```
|
||||
|
||||
```bash
|
||||
yaml r sample.yaml b[foo.bar]
|
||||
```
|
||||
|
||||
```bash
|
||||
yaml w sample.yaml b[foo.bar] 9
|
||||
```
|
||||
|
||||
Any valid yaml key can be specified as part of a key lookup.
|
||||
@@ -123,3 +123,5 @@ will output
|
||||
my:
|
||||
path: -3
|
||||
```
|
||||
|
||||
{!snippets/keys_with_dots.md!}
|
||||
|
||||
Reference in New Issue
Block a user