Reputation: 67
I'm trying to figure out how to run an INSERT (i guess update?) query to insert into rows which are nested, but latter rows also have a nested schema in themselves.
For instance i have something like
What would a general template query look like?
I know that for the lines it would look something like
Upvotes: 1
Views: 136
Reputation: 67
Managed to solve it with:
UPDATE test
SET lines=ARRAY(
SELECT line FROM UNNEST(lines) AS line
UNION ALL
SELECT (
'::someValue::,
ARRAY<STRUCT<STRING,STRING,FLOAT64>>[('someId','someString',1.0)]
)
WHERE id='someId'
Upvotes: 1