我的结论是乔特超越了我。
使用此输入数据:-
{
"cluster_id": "1",
"data": {
"id": 1,
"types": [
{
"incident_id": 10,
"incident_ref": "AAA",
"incident_code": "123",
"incident_date": "2010-11-15T00:01:00Z"
},
{
"incident_id": 20,
"incident_ref": "BBB",
"incident_code": "456",
"incident_date": "2020-11-15T00:01:00Z"
}
]
}
}
规格:-
[
{
"operation": "shift",
"spec": {
"cluster_id": "id",
"data": {
"types": {
"*": {
"incident_id": "incidents",
"incident_ref": "incidents"
}
}
}
}
}
]
提供:-
{
"id" : "1",
"incidents" : [ 10, "AAA", 20, "BBB" ]
}
如何获得以下结果:-
{
"id" : "1",
"incidents" : [
{"id": 10, "ref": "AAA", "code": "123", date: "2010-11-15T00:01:00Z"},
{"id": 20, "ref": "BBB", "code": "456", date: "2020-11-15T00:01:00Z"},
]
}
尝试了一堆排列,但一无所获!
2条答案
按热度按时间6ljaweal1#
可以使用此规范:
要防止在规范中使用
incident
文本,可以使用以下规范:pod7payv2#
您可以通过从标记名称中提取子字符串来使用两级移位转换,例如