Modify a value inside of a nested dynamic column In the table (items), I have a dynamic column (attr). 

I have a very simple nested dynamic column.

INSERT INTO items (attr) VALUES (COLUMN_CREATE('level1', COLUMN_CREATE('level2','level2_value')));


Which when viewed with: 

SELECT COLUMN_JSON(attr) FROM items;


Returns: 


  { "level1" : { "level2" : "level2_value" } }


How can I modify the "level2_value" value?

Things I've Tried

Example 1

UPDATE items SET attr=COLUMN_ADD(attr, 'level1', COLUMN_ADD(attr, 'level2', 'NEWVALUE')) WHERE id=1;



  Results in: { "level1" : { "level1" : {"level2" : "level2_value"},
  "level2" : "NEWVALUE" } }


Example 2

UPDATE items SET attr=COLUMN_ADD(COLUMN_GET(attr, 'level1' AS CHAR), 'level2', 'NEWVALUE') WHERE id=1;



  Results in: { "level2" : "NEWVALUE" }
After MUCH trial and error... This is the structure required to modify an item nested in a dynamic column.

UPDATE item SET attr=COLUMN_ADD(attr, "level1", COLUMN_ADD(COLUMN_GET(attr, "level1" as blob), "level2", "NEWVALUE")) WHERE id=1;


Which turns;


  { "level1" : { "level2" : "level2_value" } }


INTO


  { "level1" : { "level2" : "NEWVALUE" } }