mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
nicer reduce example
This commit is contained in:
parent
9072e8d3b3
commit
ee1f55630f
@ -26,7 +26,7 @@ var reduceOperatorScenarios = []expressionScenario{
|
|||||||
subdescription: "The _$context_ variable set by reduce lets you access the data outside the reduce block.",
|
subdescription: "The _$context_ variable set by reduce lets you access the data outside the reduce block.",
|
||||||
document: `a: cat`,
|
document: `a: cat`,
|
||||||
document2: `b: dog`,
|
document2: `b: dog`,
|
||||||
expression: `fileIndex as $item ireduce ({}; . * ($context | select(fileIndex==$item)) )`,
|
expression: `fi as $item ireduce ({}; . * ($context | select(fileIndex==$item)) )`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
"D0, P[], (!!map)::a: cat\nb: dog\n",
|
"D0, P[], (!!map)::a: cat\nb: dog\n",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user