我有一个JSON:
[
{
"taskId": 26,
"adsName": "test name 5",
"cityId": 2,
"regionId": 46,
"biddingPrice": 50,
"limit": 140
},
{
"taskId": 27,
"adsName": "test name 6",
"cityId": 5,
"regionId": null,
"biddingPrice": 60,
"limit": 150
},
{
"taskId": 28,
"adsName": "test name 7",
"cityId": null,
"regionId": 224,
"biddingPrice": 60,
"limit": 150
}
]
我想把cityId
和regionId
合并成一个字段cities
。顺序无关紧要,但regionId
中的值应该始终为负(带负号)。所以,从cityId = 2, regionId = 46
组合中,我期待“城市”:“2、-46”等
我期望:
[
{
"name": "test name 5",
"all_limit": 140,
"cities": "2, -46"
},
{
"name": "test name 6",
"all_limit": 150,
"cities": "5"
},
{
"name": "test name 7",
"all_limit": 150,
"cities": "-224"
}
]
1条答案
按热度按时间niwlg2el1#
您可以使用以下转换
网站http://jolt-demo.appspot.com/上的***演示***是: