Hi, here a simplfied version of my problem:
I have a json string array and want to change an excisiting element of the array:
$$jsonObject = ^jsoncreate(permanent array)
^jsonarrayinsert(permanent $$jsonObject ^"This is a test sentence.")
^jsonarrayinsert(permanent $$jsonObject ^"This is a second sentence.")
$$jsonObject[1] = ^"This is a changed sentence"
Output: ^jsonwrite($$jsonObject)
But the code leans to the following outout, the value is not changed.
Output: [“This is a test sentence.”, “This is a second sentence.”]
What makes it even weirder, if I place the array inside an json object and use this object to access and change the value, the result is different, but wrong, too
$$jsonObject = ^jsoncreate(permanent array)
^jsonarrayinsert(permanent $$jsonObject ^"This is a test sentence.")
^jsonarrayinsert(permanent $$jsonObject ^"This is a second sentence.")
$$jsonWrapper = ^jsoncreate(permanent object)
^jsonobjectinsert(permanent $$jsonWrapper array $$jsonObject)
$$jsonWrapper.array[1] = ^"This is a changed sentence"
Output: ^jsonwrite($$jsonObject)
Output: [“1]”: “This is a changed sentence”]
Is this a bug or am I missing something?
Is there a workaround for this?