2.2之后的字符串嵌入式映射

时间:2016-07-13 16:36:59

标签: orientdb orientdb2.2

我在2.2版本发布之前大约6个月开发了一些基本查询。

CREATE CLASS Flag_Definitions EXTENDS V
CREATE PROPERTY Flag_Definitions.V_status EMBEDDEDMAP STRING
CREATE PROPERTY Flag_Definitions.V_branding EMBEDDEDMAP STRING
CREATE PROPERTY Flag_Definitions.Block_type EMBEDDEDMAP STRING

CREATE VERTEX Flag_Definitions SET title = "developer reference for all data flags", V_status = {"ACTIVE":"Normal active record", "SUSPENDED":"Currently inactive record","DELETED":"Discontinued record maintained for archiving"}, Block_type = {"Prop":"Holds text from a data object property","HTML":"Holds basic HTML for content","Container":"Holds other blocks"}

但现在我在工作室中收到此错误

{"errors":[{"code":400,"reason":400,"content":"Map found but entries are not defined as :\r\n\tDB name=\"TestDB\""}]}

从控制台来看,措辞略有不同

Map found but entries are not defined as <key>:<value>

无论哪种方式,格式&#39; SET mapfield = {&#34; key&#34;:&#34; val&#34;}&#39;似乎不再有效,我无法找到解释。我甚至查看orient code on github(第118行),但是,有两个部分,格式应该通过第117行的检查。

1 个答案:

答案 0 :(得分:0)

解决了这个问题,它与Flag_Definitions对象无关,但我有一个默认状态标志应用于所有创建的顶点

CREATE PROPERTY V.flags EMBEDDEDMAP STRING
ALTER PROPERTY V.flags DEFAULT {"status":"ACTIVE"} 

问题是DEFAULT,需要

DEFAULT '{"status":"ACTIVE"}'

同样,我不得不改变 DEFAULT sysdate()DEFAULT "sysdate()"