问题描述
我有一个文件,其中包含一长串的Cypher语句,例如:
I have a file that contains a long list of Cypher statements, something like:
create (n:oeuvre {ide12:"41",numpers:[87603],titre:"JE PARS"});
create (n:oeuvre {ide12:"151",numpers:[395225,364617,396308,306762],titre:"I DID IT FOR LOVE"});
create (n:oeuvre {ide12:"67",numpers:[54001],titre:"GRAND PERE N AIME PAS LE"});
create (n:oeuvre {ide12:"80",numpers:[58356],titre:"MON HEURE DE SWING"});
create (n:oeuvre {ide12:"91",numpers:[58356],titre:"AU QUATRIEME TOP"});
当我在Cypher管理控制台区域拖放文件以导入Cypher或Grass"上拖动文件,然后单击小播放图标时,我收到消息每个查询仅预期一条语句,但得到:1405".
When I drag my file on the Cypher admin console area "Drop a file to import Cypher or Grass" and then click on the little play icon, I get the message "Expected exactly one statement per query but got: 1405".
是否可以通过管理控制台批量执行Cypher请求?措辞拖放文件以导入Cypher"似乎暗示了这一点.
Is there a way to batch execute Cypher requests via the admin console? The wording "Drop a file to import Cypher" seems to suggest so.
谢谢
Yann
推荐答案
是的,控制台只允许您一次运行一个语句.幸运的是,一条语句可以包含多个CREATE
子句,因此,如果您只删除分号字符,它应该可以工作.
Yeah, the console just let's you run one statement at a time. Fortunately a statement can have multiple CREATE
clauses, so if you just remove the semi-colon characters it should work.
或者,您可以将neo4j-shell
命令与-file
参数一起使用来运行密码脚本文件.此方法允许脚本使用由分号分隔的多个命令.
Alternatively you can use the neo4j-shell
command with the -file
argument to run a cypher script file. This method allows for scripts with multiple commands separated by semi-colons.
这篇关于尝试通过管理界面在Neo4j中执行Cypher语句列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!