User Defined Procedures and Functions

Run the following statements along to get a hang of the usage and see their results.

Call dbms.functions() to list functions.

Each procedure returns one or more columns of data. With yield these columns can be selected and also aliased and are then available in your Cypher statement.

CALL dbms.procedures()
YIELD name, signature, description as text
WHERE name STARTS WITH 'db.'
RETURN * ORDER BY name ASC

Of course you can also process the result columns with other Cypher clauses. Here we group them by package.

CALL dbms.procedures()
YIELD name, signature, description
WITH split(name,".") AS parts
RETURN parts[0..-1] AS package,  count(*) AS count,
       collect(parts[-1]) AS names
ORDER BY count DESC
package count names ["dbms","security"] 16 ["activateUser","addRoleToUser","changePassword",…​.] ["apoc","refactor"] 11 ["categorize","cloneNodes","from"…​.] ["apoc","load"] 9 ["csv","driver","jdbc","jdbcParams","json","jsoe"] ["db"] 9 ["awaitIndex","constraints","indexes","labels",..,"schema"] ["dbms"] 9 ["components","functions","queries","procedures",…​]

As of Neo4j 3.1, all functions available are directly part of the Cypher implementation, so User Defined Functions would only come from installed libraries.

You can take any procedure library and deploy it to your server to make additional procedures and functions available.


This is a companion discussion topic for the original entry at https://neo4j.com/developer/cypher/procedures-functions/