輸入:
{
"locationId": 100212,
"weatherDateGmt": 1642590000,
"geoLocation": {
"latitude": 43.80306,
"longitude": 143.89083
},
"humidity": 77,
"currentCondition": "Mostly Clear",
"latitude": 43.80306,
"longitude": 143.89083
}
想要的輸出:
"locationId": 100212,
"weatherDateGmt": 1642590000,
"humidity": 77,
"currentCondition": "Snow",
"latitude": 43.80306,
"longitude": 143.89083
我希望"currentCondition"永遠"Snow"和沒有geoLocation
這是我的震動:
[
{
"operation": "shift",
"spec": {
"geoLocation": null,
"*": "&",
"currentCondition": {
"*": { "Snow": "currentCondition" }
}
}
}
]
這是我的輸出:
{
"locationId" : 100212,
"weatherDateGmt" : 1642590000,
"humidity" : 77,
"latitude" : 43.80306,
"longitude" : 143.89083
}
已被洗掉,我該currentCondition如何修復它?
uj5u.com熱心網友回復:
您可以通過洗掉轉換洗掉這些屬性("geoLocation"和"currentCondition"),然后將符號與移位轉換一起使用,例如#
[
{
"operation": "remove",
"spec": {
"geoLocation": "",
"currentCondition": ""
}
},
{
"operation": "shift",
"spec": {
"*": "&",
"#Snow": "currentCondition"
}
}
]

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/416652.html
標籤:
上一篇:將物件串列轉換為陣列
