Hi,
Yes this works with JSON domain just as it does with XML, so lets say we have an input message of
{ "Orders": [ [ { "one": 1}, { "two": 2} ],
[ {"a": 11} ] ] }
We could use ESQL
CALL CopyEntireMessage();
DECLARE ref1 REFERENCE TO OutputRoot.JSON.Data.Orders.Item[1].Item[2];
DETACH ref1;
ATTACH ref1 TO OutputRoot.JSON.Data.Orders.Item[2] AS LASTCHILD;
To move the first array second entry to the second
{ "Orders": [ [ {"one":1} ],
[ {"a":11}, {"two":2} ] ] }
HTH
------------------------------
Martin Boag
Software Developer
IBM
------------------------------
Original Message:
Sent: Tue July 27, 2021 01:25 PM
From: SELVAKUMAR ANANTHARAJ
Subject: DETACH and ATTACH
Hi Team,
I have used DETACH and ATTACH for adding and removing xml Element. It works fine with XML message.
I would like to know is there anything for manipulating json like removing one or more keys in
InputRoot.JSON.Data and attaching the updated InputRoot.JSON.Data to OutputRoot.JSON.Data
Any help will be greatly appreciated!!
------------------------------
SELVAKUMAR ANANTHARAJ
------------------------------