mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
fixed boolean example
This commit is contained in:
parent
663413cd7a
commit
356aac5a1f
@ -32,13 +32,13 @@ Given a sample.yml file of:
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.[] | select(.a == "cat" or .b == "dog")' sample.yml
|
||||
yq eval '[.[] | select(.a == "cat" or .b == "dog")]' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
a: bird
|
||||
b: dog
|
||||
a: cat
|
||||
b: fly
|
||||
- a: bird
|
||||
b: dog
|
||||
- a: cat
|
||||
b: fly
|
||||
```
|
||||
|
||||
|
@ -22,10 +22,9 @@ var booleanOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
document: "[{a: bird, b: dog}, {a: frog, b: bird}, {a: cat, b: fly}]",
|
||||
description: "Matching nodes with select, equals and or",
|
||||
expression: `.[] | select(.a == "cat" or .b == "dog")`,
|
||||
expression: `[.[] | select(.a == "cat" or .b == "dog")]`,
|
||||
expected: []string{
|
||||
"D0, P[0], (!!map)::{a: bird, b: dog}\n",
|
||||
"D0, P[2], (!!map)::{a: cat, b: fly}\n",
|
||||
"D0, P[], (!!seq)::- {a: bird, b: dog}\n- {a: cat, b: fly}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user