Added space example to docs

This commit is contained in:
Mike Farah
2021-02-05 15:00:46 +11:00
parent e0fdbe7f35
commit e9c5573a89
2 changed files with 25 additions and 0 deletions
+16
View File
@@ -48,6 +48,22 @@ will output
frog
```
## Keys with spaces
Use quotes with brackets around path elements with special characters
Given a sample.yml file of:
```yaml
"red rabbit": frog
```
then
```bash
yq eval '.["red rabbit"]' sample.yml
```
will output
```yaml
frog
```
## Dynamic keys
Expressions within [] can be used to dynamically lookup / calculate keys