0
內的用戶類型我有這個表和用戶類型編輯地圖
CREATE TYPE IF NOT EXISTS criteria (
id text,
enumerate text,
name text,
description text,
);
CREATE TYPE IF NOT EXISTS module (
id text,
enumerate text,
name text,
description text,
criteria map<int, frozen<criteria>>
);
CREATE TABLE IF NOT EXISTS certification (
id timeuuid,
owner text,
description text,
name text,
template map<int, frozen<module>>,
images map<text, text>,
PRIMARY KEY (id, owner)
);
如何更新或與標準的地圖添加新數據。
首先在模板字段
UPDATE certification set template = template +
{1:{
id: '***',
enumerate: '***',
name: 'aaa',
description: 'aaa',
criteria: {}
}}
where owner='***' and id = ***;
後添加數據,我想更新的標準。我是想這個(認證表已有數據和模板字段映射鍵= 1):
UPDATE certification set
template[1].criteria = template[1].criteria +
{1:{
id: 'xxxx',
enumerate: 'xxxx',
name: 'xxxx',
description: 'xxxx'
}}
where owner='****' and id = ***;
或template[1]['criteria']
,但我得到一個錯誤。
SyntaxException: line 2:27 mismatched input '.' expecting '='