The below is the document which has the two same nesting name as Bundle. I would like to select the column which is Bundle.Bundle.component. compinst .
Many thanks. It has worked. Now I would like to make it an update query but it is failing.
update 'document` as d unnest d.Bundles AS b1
unnest b1.Bundles As b2
unnest b2.components as comp
set comp.inactiveDt=CLOCK_LOCAL()
where d.accountNo=1234and d.type=“appliedProduct” and comp.compinst =999999;
UPDATE `document` AS d
SET comp.inactiveDt=CLOCK_LOCAL()
FOR comp IN b2.components
FOR b2 IN b1.Bundles
FOR b1 IN d.Bundles WHEN comp.compinst =999999 END
WHERE d.type="appliedProduct" AND d.accountNo=1234 ;
Hi, You are right, after changing the date format, I am able to update the record.
UPDATE document AS d
SET comp.inactiveDt=CLOCK_TZ(‘UTC’)
FOR comp IN b2.components
FOR b2 IN b1.Bundles
FOR b1 IN d.Bundles WHEN comp.compinst =999999 END
WHERE d.type=“appliedProduct” AND d.accountNo=1234 ;