jq - 我怎样才能将我的列表列表扁平化为一个级别列表

jq - how can I flat my list of lists into one level list

我怎样才能改变我的 json

{
    "clients": [
    {
     "id" : "qwerty",
     "accounts" : [{"number" : "6666"}, {"number" : "7777"}]
    },
    {
     "id" : "zxcvb",
     "accounts" : [{"number" : "1111"}, {"number" : "2222"}] 
    }
]
}

转换为 json 的以下类型?使用 JQ

{
"items": [
{
"id" : "qwerty",
"number" : "6666"
},{
"id" : "qwerty",
"number" : "7777"
},{
"id" : "zxcvb",
"number" : "1111"
},{
"id" : "zxcvb",
"number" : "2222"
}]
}

JQ有哪些工具可以帮到我?我无法选择任何可能的方式来做到这一点

像这样应该可以解决问题:

{items: [.clients[] | {id} + .accounts[]]}

Online demo