将 huddle 插入一个键

Insert huddle to a key

期望的输出:

{"series": [
    {
      "Name": "serie1",
      "data": [
        12,
        99,
        35
      ]
    },
    {
      "Name": "serie2",
      "data": [
        12,
        50,
        35
      ]
    }
  ]}

我有 3 个这样的小伙伴:

set serieskey {HUDDLE {D {series {L {}}}}}
set serie1 {HUDDLE {D {Name {s serie1} data {L {{num 12} {num 99} {num 35}}}}}}
set serie2 {HUDDLE {D {Name {s serie2} data {L {{num 12} {num 50} {num 35}}}}}}

huddle combine $serieskey $serie1

HUDDLE {D {series {L {}} Name {s serie1} data {L {{num 12} {num 99} {num 35}}}}}
> {
  "series": [
    
  ],
  "Name": "serie1",
  "data": [
    12,
    99,
    35
  ]
}

从我的 series

中添加

也许 huddle append 可以完成这项工作,但我不知道如何使用它,因为我的主密钥已经存在...

我终于用set命令找到了:

huddle set serieskey series 0 $serie1
huddle set serieskey series 1 $serie2

希望对其他人有所帮助...