有没有一种方法可以在neo4j shell中使用命令运行脚本文件?

有没有一种方法可以在neo4j shell中使用命令运行脚本文件?,neo4j,missing-features,Neo4j,Missing Features,我想使用neo4j的shell或power控制台中的命令运行脚本文件。 有办法吗 澄清:这实际上是从shell中运行脚本的目标 类似于用于运行groovy脚本的gsh命令。看看Mark Needham的世界杯数据集GitHub示例,他使用Neo4j shell运行一系列用于数据导入的Cypher脚本 确保已导出系统变量$WC_DB,以包含运行的Neo4j实例的路径。您可以看到,--file标志允许您将密码脚本作为文件作为参数传递给neo4j shell。您能澄清一下吗?您想从neo4j she

我想使用neo4j的shell或power控制台中的命令运行脚本文件。 有办法吗

澄清:这实际上是从shell中运行脚本的目标


类似于用于运行groovy脚本的gsh命令。

看看Mark Needham的世界杯数据集GitHub示例,他使用Neo4j shell运行一系列用于数据导入的Cypher脚本


确保已导出系统变量
$WC_DB
,以包含运行的Neo4j实例的路径。您可以看到,
--file
标志允许您将密码脚本作为文件作为参数传递给
neo4j shell

您能澄清一下吗?您想从neo4j shell内部运行一个shell脚本,还是想使用neo4j shell从linux shell运行密码?
#! /bin/bash
set -e

if [[ -z "$WC_DB" ]]; then
    echo "Make sure you set \$WC_DB before running this script"
    echo "e.g. export WC_DB=\"/path/to/neo4j-community-2.1.4\""
    exit 1
fi

echo "starting up Neo4j instance at ${WC_DB}"
${WC_DB}/bin/neo4j status
if [ $? -ne 0 ]; then
    echo "Neo4j not started. Run ${WC_DB}/bin/neo4j start before running this script"   
fi

${WC_DB}/bin/neo4j-shell --file data/import/clear.cyp
${WC_DB}/bin/neo4j-shell --file data/import/indexes.cyp
${WC_DB}/bin/neo4j-shell --file data/import/loadMatches.cyp
${WC_DB}/bin/neo4j-shell --file data/import/loadSquads.cyp
${WC_DB}/bin/neo4j-shell --file data/import/loadLineUps.cyp
${WC_DB}/bin/neo4j-shell --file data/import/loadEvents.cyp
${WC_DB}/bin/neo4j-shell --file data/import/connectAdjacentWorldCups.cyp
${WC_DB}/bin/neo4j-shell --file data/import/addGeoLocations.cyp
${WC_DB}/bin/neo4j-shell --file data/import/loadCountryInformation.cyp
${WC_DB}/bin/neo4j-shell --file data/import/addContinents.cyp