mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Adding splat[] short hand to explode,collect,flatten,groupby,path,pivot,select and more
This commit is contained in:
@@ -28,6 +28,16 @@ var collectObjectOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (!!map)::dog: great\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "collect splat",
|
||||
skipDoc: true,
|
||||
document: `[{name: cat}, {name: dog}]`,
|
||||
expression: `.[] | {.name: "great"}[]`,
|
||||
expected: []string{
|
||||
"D0, P[cat], (!!str)::great\n",
|
||||
"D0, P[dog], (!!str)::great\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
expression: `({} + {}) | (.b = 3)`,
|
||||
|
||||
Reference in New Issue
Block a user