Control & advanced
Bind a value to a variable
as binds a value while letting the remaining pipeline keep its original input.
. as $root | .users[] | {name, team: $root.team}Input and expected output
Input
{"team":"compiler","users":[{"name":"Ada"},{"name":"Grace"}]}Expected output
{
"name": "Ada",
"team": "compiler"
}
{
"name": "Grace",
"team": "compiler"
}