How to use SlowCheetah to transform an array elements in Json config file?

Viewed 2822

It's my first time using SlowCheetah for JSON config file. I could not find a way to let it transform an array settings. For example, if my base config file has this setting:

{
  "Settings" :  [1, 2, 3] 
}

and I want to transfer it to:

{
  "Settings" :  [4, 5, 6] 
}

It simply does the merge, instead of replacement. Is there a way I can tell it what to do? Like the way we using xdt:Transform="Replace" in xml config file.

1 Answers

This transformation will do the job:

{
  "@jdt.replace": {
    "@jdt.path": "$.Settings",
    "@jdt.value": [4,5,6]
  }
}
Related