我到处寻找,但找不到这个问题的答案。
我需要创建一个节点Config
它有一个带有 2 个键/值对的动态属性对象(例如,name
and type
)。查询时,键应该最终为properties.name
and properties.type
。但我似乎无法正确创建语法。这就是我正在做的:
CREATE (c1:Config) set c1.properties=[{name:"CiPipelineConfig1"}, {type:"test"}]
但这给了我一些奇怪的错误:
Neo.ClientError.Statement.TypeError: Neo4j only supports a subset of Cypher types for storage as singleton or array properties.
谁能帮我解决这个查询吗?
Neo4j 有一个限制财产种类 https://neo4j.com/docs/developer-manual/current/cypher/syntax/values/ set.
您应该将这些值存储为节点的属性,而不是将它们塞入一个属性中。
// You need the `` around the property name to escape the period
CREATE (c1:Config) set c1.`properties.name`="CiPipelineConfig1" set c1.`properties.type`="test"
如果这对您来说还不够好,您将需要将数据重新格式化为与 Neo4j 类型兼容的内容。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)