Neo4j shell导入抛出 - 未知命令' foreach'

时间:2015-03-30 13:01:47

标签: neo4j cypher

尝试使用Neo4j 2.1.7 / 2.2.0版 CQL包含=> FOREACH(姓名在[" Hindu","穆斯林"," Christian"," Jain"] | CREATE(:Religion {title:name }));

我无法使用neo4j shell导入它。错误抛出:未知命令' foreach'。

我通过PHP生成CQL文件。

1 个答案:

答案 0 :(得分:2)

似乎neo4j-shell并不知道有效的cypher语句可以以FOREACH开头。一个简单的解决方法是从WITH开始:

with ["Hindu","Muslim","Christian","Jain"] as r 
foreach (name in r|create (:Religion{title:name}));