Create object using n1ql update

Without parent field an object you can’t update sub field. i.e There is no b or b.c so you can’t update b.c.d

Try one of these

UPDATE default USE KEYS "test" SET b = {}, b.c = {}, b.c.d=2,e=[{"f":3},{"g":4}];
UPDATE default USE KEYS "test" SET b = {"c":{"d":2}},e=[{"f":3},{"g":4}];
1 Like