Ana içeriğe geç

Yeni Bir Key İfadesi Ekleme ve Var Olan Bir Key İfadesini Silme

Giriş Değeri

{
"Rating": 1,
"SecondaryRatings": {
"Design": 4,
"Price": 2,
"RatingDimension3": 1
}
}

JOLT Dönüşüm Kodu

ipucu

Bu örnekte önce remove operasyonu ile Rating alanı silinir, sonra default operasyonu ile NewlyAddedField alanı eklenir.

[
{
"operation": "remove",
"spec": {
"Rating": ""
}
},
{
"operation": "default",
"spec": {
"NewlyAddedField": "123"
}
}
]

Çıkış Değeri

{
"SecondaryRatings" : {
"Design" : 4,
"Price" : 2,
"RatingDimension3" : 1
},
"NewlyAddedField" : "123"
}