Neo4j APOC 将 CSV 导出到特定目录

Neo4j APOC Export CSV to specific Directory

以下查询对我来说很好

CALL apoc.export.csv.query("MATCH (a:Person)
RETURN a.name AS name", "result.csv", {})

但我想将结果导出到特定目录,例如 'test' 目录 /neo4j-community-3.2.6/test/result.csv

测试目录存在于neo4j-community-3.2.6文件夹中,但是查询

CALL apoc.export.csv.query("
    MATCH (a:Person)
    RETURN a.name AS name",
"/test/result.csv", {})

给我以下错误:

Neo.ClientError.Procedure.ProcedureCallFailed Failed to invoke procedure apoc.export.csv.query: Caused by: java.io.FileNotFoundException: \test\result.csv (The system cannot find the path specified)

有人能帮忙吗?

已解决。我得到了用户 "tomasi" 的 "neo4j-users.slack.com" 的帮助。 为此我们需要在参数中提供完整的路径:

CALL apoc.export.csv.query("MATCH (a:Person)
    RETURN a.name AS name",
"/home/xyzuser/neo4j-community-3.2.6/test/result.csv", {})

文件默认保存在bin文件夹中。 将文件位置指定为 '../test/result.csv' 可能有效。 在我的案例中有效