having a data eg like:
[ {"user": {"foo": "a1","bar": "b1" },"data": [ {"baz": "c1.1","beq": "d1.1" }, {"baz": "c1.2","beq": "d1.2" } ] }, {"user": {"foo": "a2","bar": "b2" },"data": [ {"baz": "c2.1","beq": "d2.1" }, {"baz": "c2.2","beq": "d2.2" }, {"baz": "c2.3","beq": "d2.3" } ] }]i want to "ungroup" it into a csv-like output
a1 b1 d1.1a1 b1 d1.2a2 b2 d2.1a2 b2 d2.2a2 b2 d2.3i was able to achieve it (https://play.jqlang.org/s/G8PLRDlxx4Ym3-W), but with a foreach and assigning the data to some variable - well generally it looks pretty clumsy
.[] | .user as $user | foreach .data[] as $d ([]; . ; . + [$user.foo, $user.bar, $d.beq]) | @tsvisn't there a simpler way?