Displayed below is a sample of JSON input data:
{
"India":{
"Attributes":{"Time":"2006-05-04T03:22:11.499Z"},
"ActiveCity":{
"profile":"Mumbai"
},
"CurrentCities":{
"Mumbai":{"population":"121212121","Area":8},
"Delhi":{"population":"121212121","Area":8},
"Lonng":{"population":"121212121","Area":8}
},
"FeatureCities":{
"NewMumbai":{"population":"121212121","Area":8},
"NewDelhi":{"population":"121212121","Area":8},
"NewLonng":{"population":"121212121","Area":8}
}
}
}
My goal in TypeScript is to replace the CurrentCities section with only ActiveCity. For example, my desired output should be as follows:
{
"India":{
"Attributes":{"Time":"2006-05-04T03:22:11.499Z"},
"ActiveCity":{
"profile":"Mumbai"
},
"CurrentCities":{
"Mumbai":{"population":"121212121","Area":8}
},
"FeatureCities":{
"NewMumbai":{"population":"121212121","Area":8},
"NewDelhi":{"population":"121212121","Area":8},
"NewLonng":{"population":"121212121","Area":8}
}
}
}
If you have suggestions on how I can achieve this using Jsonpath in TypeScript, please let me know. Thank you!