neo4j UNWIND CREATE预期n为地图

时间:2015-11-13 14:12:49

标签: neo4j

使用UNWIND在neo4j 2.3中创建多个节点我遇到'预期n是一张地图'。在neo4j-shell中,处理单个地图有效:

neo4j-sh (?)$ export key={name:'foo'}
neo4j-sh (?)$ create (n:test) set n={key};
Nodes created: 1

但是我在数组上使用UNWIND:

neo4j-sh (?)$ export keys=[{name:'foo'}]
neo4j-sh (?)$ unwind {keys} as key create (n:test) set n=key;
WARNING: Expected n to be a map, but it was :`{"name":"foo"}`

当我通过REST打电话时也是如此。我猜它与neo4j处理参数有关。提供这个的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

是的,它可能是参数。这有点奇怪。如果你试过这个怎么办:

WITH {keys} AS keys
UNWIND keys as key
CREATE (n:test) SET n=key;