Chapter 13. Cypher Execution

CALL apoc.cypher.run(fragment, params) yield value

executes reading fragment with the given parameters

apoc.cypher.runFirstColumnSingle(statement, params)

function that executes statement with given parameters returning first column only, will return first/single row or null

apoc.cypher.runFirstColumnMany(statement, params)

function that executes statement with given parameters returning first column only, will collect all rows into a list

CALL apoc.cypher.runFile(file or url,{config}) yield row, result

runs each statement in the file, all semicolon separated - currently no schema operations

CALL apoc.cypher.runFiles([files or urls],{config}) yield row, result

runs each statement in the files, all semicolon separated

CALL apoc.cypher.runSchemaFile(file or url,{config}) - allows only schema operations, runs each schema statement in the file, all semicolon separated

CALL apoc.cypher.runSchemaFiles([files or urls],{config}) - allows only schema operations, runs each schema statement in the files, all semicolon separated

CALL apoc.cypher.runMany('cypher;\nstatements;',{params},{config})

runs each semicolon separated statement and returns summary - currently no schema operations

CALL apoc.cypher.mapParallel(fragment, params, list-to-parallelize) yield value

executes fragment in parallel batches with the list segments being assigned to _

CALL apoc.cypher.doIt(fragment, params) yield value

executes writing fragment with the given parameters

CALL apoc.cypher.runTimeboxed('cypherStatement',{params}, timeout)

abort statement after timeout millis if not finished

13.5. apoc.periodic.countdown

Repeats a statement until the termination is reached. The statement must return a numeric value and it should decrement (like a monotonically decreasing function). When the return value reaches 0 than the iteration stops. For example, define a counter with a numeric property:

CREATE (counter:Counter) SET counter.c = 10

and decrement this property by 1 each second:

CALL apoc.periodic.countdown('decrement',"MATCH (counter:Counter) SET counter.c = counter.c - 1 RETURN counter.c as count", 1)