apoc.custom.declareFunction

Procedure Apoc Extended

apoc.custom.declareFunction(signature, statement, forceSingle, description) - register a custom cypher function

Signature

apoc.custom.declareFunction(signature :: STRING?, statement :: STRING?, forceSingle = false :: BOOLEAN?, description =  :: STRING?) :: VOID

This procedure is not intended to be used in a cluster environment, and may act unpredictably.

Input parameters

Name Type Default

signature

STRING?

null

statement

STRING?

null

forceSingle

BOOLEAN?

false

description

STRING?

Usage Examples

We can create the function custom.double, that doubles the provided value, by running the following function:

CALL apoc.custom.declareFunction(
  'double(input::INT) :: INT',
  'RETURN $input*2 as answer'
);
Function, input and output names must have at least 2 characters.

We can use this function, as shown in the query below:

RETURN custom.double(83) AS value;
Table 1. Results
value

166