mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Added prepend array example
This commit is contained in:
@@ -101,6 +101,14 @@ var addOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (doc)::a: ['dog', 'cat']\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Prepend to existing array",
|
||||
document: `a: [dog]`,
|
||||
expression: `.a = ["cat"] + .a`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::a: [cat, dog]\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Concatenate to existing array",
|
||||
|
||||
Reference in New Issue
Block a user