Adding splat[] short hand to explode,collect,flatten,groupby,path,pivot,select and more

This commit is contained in:
Mike Farah
2024-06-16 10:48:01 +10:00
parent f1964dece0
commit d58870b056
14 changed files with 146 additions and 13 deletions
+10
View File
@@ -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)`,