运行 Cypher 脚本文件

运行文件中的每个语句/每个文件,所有以分号分隔的语句

这些过程可用于运行通常由 cypher-shell 运行的文件。它们会自动跳过 :begin/:commit/:rollback 操作,因为它们在每个文件的单个事务中执行。

过程概述

下表描述了可用的过程和函数

限定名称 类型 版本

apoc.cypher.runFileReadOnly

apoc.cypher.runFileReadOnly(file or url,[{timeout:10,parameters:{}}]) - 运行文件中每个 READ 语句,所有以分号分隔的语句

过程

Apoc 扩展

apoc.cypher.runFilesReadOnly

apoc.cypher.runFilesReadOnly([files or urls],[{timeout:10,parameters:{}}])) - 运行文件中每个 READ 语句,所有以分号分隔的语句

过程

Apoc 扩展

apoc.cypher.runFile

apoc.cypher.runFile(file or url,[{statistics:true,timeout:10,parameters:{}}]) - 运行文件中每个语句,所有以分号分隔的语句

过程

Apoc 扩展

apoc.cypher.runFiles

apoc.cypher.runFiles([files or urls],[{statistics:true,timeout:10,parameters:{}}])) - 运行文件中每个语句,所有以分号分隔的语句

过程

Apoc 扩展

apoc.cypher.runSchemaFile

apoc.cypher.runSchemaFile(file or url,[{statistics:true,timeout:10}]) - 只允许模式操作,运行文件中每个模式语句,所有以分号分隔的语句

过程

Apoc 扩展

apoc.cypher.runSchemaFiles

apoc.cypher.runSchemaFiles([files or urls],{statistics:true,timeout:10}) - 只允许模式操作,运行文件中每个模式语句,所有以分号分隔的语句

过程

Apoc 扩展

仅限读取操作

  • apoc.cypher.runFileReadOnly(file or url,[{config}])

  • apoc.cypher.runFilesReadOnly([files or urls],[{config})])

仅限数据操作

  • apoc.cypher.runFile(file or url,[{config}])

  • apoc.cypher.runFiles([files or urls],[{config})])

apoc.cypher.run*File(s) 过程具有一些可选配置

  • {statistics:true/false} 用于输出每个语句的更新统计信息行,默认值为 true

  • {timeout:1 or 10} 用于流等待新数据的持续时间,默认值为 10

仅限模式操作

  • apoc.cypher.runSchemaFile(file or url,[{config}])

  • apoc.cypher.runSchemaFiles([files or urls],[{config})])