如何在脚本文件中划分多个Neo4j cypher查询?

use*_*534 3 neo4j cypher

我以编程方式生成了一堆密码查询来填充Neo4j数据库.我想在端口7474使用数据库访问页面的拖放功能来加载语句.我可以很好地执行个别陈述.但是聚合语句(用';'分隔)会产生语法错误.

Mic*_*ger 5

您可以使用neo4j-shell(Neo4jShell.bat)来运行由...分隔的多个语句 ;

shell存在于binneo4j服务器的目录中,但也可以在localhost:7474/webadmin/#/console/.

默认情况下,它连接到正在运行的服务器,但您也可以指定数据库目录:

bin/neo4j-shell -path test.db [-config conf/neo4j.properties] [-file import.cql]
Run Code Online (Sandbox Code Playgroud)

并且您可以传递要读取和执行的文件(例如,用于导入).

在Unix系统上,你也可以管道到shell:

cat import.cql | bin/neo4j-shell -path test.db
Run Code Online (Sandbox Code Playgroud)

有关shell的更多乐趣,请参阅Rik的博客,还有http://www.neo4j.org/develop/shell