是否存在将转换此内容的jmespath表达式:
{ "a": 5
, "b": [ {"c":6}, {"c":7}, {"c":8}]
}
进入这个:
[ {"a":5, "c":6}
, {"a":5, "c":7}
, {"a":5, "c":8}
]
非常感谢提前!
答案 0 :(得分:0)
给出以下数据集...
{ "a": 5
, "b": [ {"c":6}, {"c":7}, {"c":8}]
}
...以下jmespath查询...
[
@.{"a":"a","c":"b"[0].c}
, @.{"a":"a","c":"b"[1].c}
, @.{"a":"a","c":"b"[2].c}
]
...产生以下结果
[
{"a":5, "c":6}
, {"a":5, "c":7}
, {"a":5, "c":8}
]