Checkout Merge two child documents
SELECT ARRAY_FLATTEN(ARRAY ARRAY_CONCAT([{"type":"major", "versionName":v.name}],
ARRAY {"versionName":v2,"type":"minor"} FOR v2 IN v.val END)
FOR v IN OBJECT_PAIRS(d.data) END,1)
FROM default d WHERE type = "versions";