A.2. Built-in procedures

This section contains a reference of Neo4j built-in procedures.

A.2.1. Procedures, editions and modes

The procedures available depends on the type of installation. Enterprise Edition provides a fuller set of procedures than Community Edition. Cluster members have procedures that are not available in standalone mode.

The cluster-specific procedures are not included in this reference, instead see Section 8.4.1, “Procedures for monitoring a Causal Cluster”. To check which procedures are available in your Neo4j instance, use the dbms.procedures() procedure.

Example A.1. List available procedures

To list the procedures available on your particular installation, run the following command in Neo4j Browser or in Cypher Shell:

CALL dbms.procedures()

A.2.2. Procedure reference

The procedure reference section contains the following:

A.2.3. Enterprise Edition procedures

Table A.260. Enterprise Edition procedures
Name Description Signature Roles

db.awaitIndex()

Wait for an index to come online (for example: CALL db.awaitIndex(":Person(name)")).

db.awaitIndex(index :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID

reader, editor, publisher, architect, admin

db.awaitIndexes()

Wait for all indexes to come online (for example: CALL db.awaitIndexes("500")).

db.awaitIndexes(timeOutSeconds = 300 :: INTEGER?) :: VOID

reader, editor, publisher, architect, admin

db.constraints()

List all constraints in the database.

db.constraints() :: (description :: STRING?)

reader, editor, publisher, architect, admin

db.createLabel()

Create a label

db.createLabel(newLabel :: STRING?) :: VOID

editor, publisher, architect, admin

db.createProperty()

Create a Property

db.createProperty(newProperty :: STRING?) :: VOID

editor, publisher, architect, admin

db.createRelationshipType()

Create a RelationshipType

db.createRelationshipType(newRelationshipType :: STRING?) :: VOID

editor, publisher, architect, admin

db.index.explicit.addNode()

Add a node to an explicit index based on a specified key and value

db.index.explicit.addNode(indexName :: STRING?, node :: NODE?, key :: STRING?, value :: ANY?) :: (success :: BOOLEAN?)

editor, publisher, architect, admin

db.index.explicit.addRelationship()

Add a relationship to an explicit index based on a specified key and value

db.index.explicit.addRelationship(indexName :: STRING?, relationship :: RELATIONSHIP?, key :: STRING?, value :: ANY?) :: (success :: BOOLEAN?)

editor, publisher, architect, admin

db.index.explicit.auto.searchNodes()

Search nodes in explicit automatic index. Replaces START n=node:node_auto_index('key:foo*')

db.index.explicit.auto.searchNodes(query :: ANY?) :: (node :: NODE?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.auto.searchRelationships()

Search relationship in explicit automatic index. Replaces START r=relationship:relationship_auto_index('key:foo*')

db.index.explicit.auto.searchRelationships(query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.auto.seekNodes()

Get node from explicit automatic index. Replaces START n=node:node_auto_index(key = 'A')

db.index.explicit.auto.seekNodes(key :: STRING?, value :: ANY?) :: (node :: NODE?)

reader, editor, publisher, architect, admin

db.index.explicit.auto.seekRelationships()

Get relationship from explicit automatic index. Replaces START r=relationship:relationship_auto_index(key = 'A')

db.index.explicit.auto.seekRelationships(key :: STRING?, value :: ANY?) :: (relationship :: RELATIONSHIP?)

reader, editor, publisher, architect, admin

db.index.explicit.drop()

Remove an explicit index - YIELD type,name,config

db.index.explicit.drop(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

editor, publisher, architect, admin

db.index.explicit.existsForNodes()

Check if a node explicit index exists

db.index.explicit.existsForNodes(indexName :: STRING?) :: (success :: BOOLEAN?)

reader, editor, publisher, architect, admin

db.index.explicit.existsForRelationships()

Check if a relationship explicit index exists

db.index.explicit.existsForRelationships(indexName :: STRING?) :: (success :: BOOLEAN?)

reader, editor, publisher, architect, admin

db.index.explicit.forNodes()

Get or create a node explicit index - YIELD type,name,config

db.index.explicit.forNodes(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

editor, publisher, architect, admin

db.index.explicit.forRelationships()

Get or create a relationship explicit index - YIELD type,name,config

db.index.explicit.forRelationships(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

editor, publisher, architect, admin

db.index.explicit.list()

List all explicit indexes - YIELD type,name,config

db.index.explicit.list() :: (type :: STRING?, name :: STRING?, config :: MAP?)

reader, editor, publisher, architect, admin

db.index.explicit.removeNode()

Remove a node from an explicit index with an optional key

db.index.explicit.removeNode(indexName :: STRING?, node :: NODE?, key :: STRING?) :: (success :: BOOLEAN?)

editor, publisher, architect, admin

db.index.explicit.removeRelationship()

Remove a relationship from an explicit index with an optional key

db.index.explicit.removeRelationship(indexName :: STRING?, relationship :: RELATIONSHIP?, key :: STRING?) :: (success :: BOOLEAN?)

editor, publisher, architect, admin

db.index.explicit.searchNodes()

Search nodes in explicit index. Replaces START n=node:nodes('key:foo*')

db.index.explicit.searchNodes(indexName :: STRING?, query :: ANY?) :: (node :: NODE?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.searchRelationships()

Search relationship in explicit index. Replaces START r=relationship:relIndex('key:foo*')

db.index.explicit.searchRelationships(indexName :: STRING?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.searchRelationshipsBetween()

Search relationship in explicit index, starting at the node 'in' and ending at 'out'.

db.index.explicit.searchRelationshipsBetween(indexName :: STRING?, in :: NODE?, out :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.searchRelationshipsIn()

Search relationship in explicit index, starting at the node 'in'.

db.index.explicit.searchRelationshipsIn(indexName :: STRING?, in :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.searchRelationshipsOut()

Search relationship in explicit index, ending at the node 'out'.

db.index.explicit.searchRelationshipsOut(indexName :: STRING?, out :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

reader, editor, publisher, architect, admin

db.index.explicit.seekNodes()

Get node from explicit index. Replaces START n=node:nodes(key = 'A')

db.index.explicit.seekNodes(indexName :: STRING?, key :: STRING?, value :: ANY?) :: (node :: NODE?)

reader, editor, publisher, architect, admin

db.index.explicit.seekRelationships()

Get relationship from explicit index. Replaces START r=relationship:relIndex(key = 'A')

db.index.explicit.seekRelationships(indexName :: STRING?, key :: STRING?, value :: ANY?) :: (relationship :: RELATIONSHIP?)

reader, editor, publisher, architect, admin

db.indexes()

List all indexes in the database.

db.indexes() :: (description :: STRING?, label :: STRING?, properties :: LIST? OF STRING?, state :: STRING?, type :: STRING?, provider :: MAP?)

reader, editor, publisher, architect, admin

db.labels()

List all labels in the database.

db.labels() :: (label :: STRING?)

reader, editor, publisher, architect, admin

db.propertyKeys()

List all property keys in the database.

db.propertyKeys() :: (propertyKey :: STRING?)

reader, editor, publisher, architect, admin

db.relationshipTypes()

List all relationship types in the database.

db.relationshipTypes() :: (relationshipType :: STRING?)

reader, editor, publisher, architect, admin

db.resampleIndex()

Schedule resampling of an index (for example: CALL db.resampleIndex(":Person(name)")).

db.resampleIndex(index :: STRING?) :: VOID

reader, editor, publisher, architect, admin

db.resampleOutdatedIndexes()

Schedule resampling of all outdated indexes.

db.resampleOutdatedIndexes() :: VOID

reader, editor, publisher, architect, admin

db.schema()

Show the schema of the data.

db.schema() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)

reader, editor, publisher, architect, admin

dbms.changePassword()

Change the current user’s password. Deprecated by dbms.security.changePassword.

dbms.changePassword(password :: STRING?) :: VOID

reader, editor, publisher, architect, admin

dbms.components()

List DBMS components and their versions.

dbms.components() :: (name :: STRING?, versions :: LIST? OF STRING?, edition :: STRING?)

reader, editor, publisher, architect, admin

dbms.functions()

List all user functions in the DBMS.

dbms.functions() :: (name :: STRING?, signature :: STRING?, description :: STRING?, roles :: LIST? OF STRING?)

reader, editor, publisher, architect, admin

dbms.getTXMetaData()

Provides attached transaction metadata.

dbms.getTXMetaData() :: (metadata :: MAP?)

reader, editor, publisher, architect, admin

dbms.killQueries()

Kill all transactions executing a query with any of the given query ids.

dbms.killQueries(ids :: LIST? OF STRING?) :: (queryId :: STRING?, username :: STRING?, message :: STRING?)

reader, editor, publisher, architect, admin

dbms.killQuery()

Kill all transactions executing the query with the given query id.

dbms.killQuery(id :: STRING?) :: (queryId :: STRING?, username :: STRING?, message :: STRING?)

reader, editor, publisher, architect, admin

dbms.listActiveLocks()

List the active lock requests granted for the transaction executing the query with the given query id.

dbms.listActiveLocks(queryId :: STRING?) :: (mode :: STRING?, resourceType :: STRING?, resourceId :: INTEGER?)

reader, editor, publisher, architect, admin

dbms.listConfig()

List the currently active config of Neo4j.

dbms.listConfig(searchString = :: STRING?) :: (name :: STRING?, description :: STRING?, value :: STRING?)

admin

dbms.listQueries()

List all queries currently executing at this instance that are visible to the user.

dbms.listQueries() :: (queryId :: STRING?, username :: STRING?, metaData :: MAP?, query :: STRING?, parameters :: MAP?, planner :: STRING?, runtime :: STRING?, indexes :: LIST? OF MAP?, startTime :: STRING?, elapsedTime :: STRING?, connectionDetails :: STRING?, protocol :: STRING?, clientAddress :: STRING?, requestUri :: STRING?, status :: STRING?, resourceInformation :: MAP?, activeLockCount :: INTEGER?, elapsedTimeMillis :: INTEGER?, cpuTimeMillis :: INTEGER?, waitTimeMillis :: INTEGER?, idleTimeMillis :: INTEGER?, allocatedBytes :: INTEGER?, pageHits :: INTEGER?, pageFaults :: INTEGER?)

reader, editor, publisher, architect, admin

dbms.procedures()

List all procedures in the DBMS.

dbms.procedures() :: (name :: STRING?, signature :: STRING?, description :: STRING?, roles :: LIST? OF STRING?)

reader, editor, publisher, architect, admin

dbms.queryJmx()

Query JMX management data by domain and name. For instance, "org.neo4j:*"

dbms.queryJmx(query :: STRING?) :: (name :: STRING?, description :: STRING?, attributes :: MAP?)

reader, editor, publisher, architect, admin

dbms.security.activateUser()

Activate a suspended user.

dbms.security.activateUser(username :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID

admin

dbms.security.addRoleToUser()

Assign a role to the user.

dbms.security.addRoleToUser(roleName :: STRING?, username :: STRING?) :: VOID

admin

dbms.security.changePassword()

Change the current user’s password.

dbms.security.changePassword(password :: STRING?, requirePasswordChange = false :: BOOLEAN?) :: VOID

reader, editor, publisher, architect, admin

dbms.security.changeUserPassword()

Change the given user’s password.

dbms.security.changeUserPassword(username :: STRING?, newPassword :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID

admin

dbms.security.clearAuthCache()

Clears authentication and authorization cache.

dbms.security.clearAuthCache() :: VOID

admin

dbms.security.createRole()

Create a new role.

dbms.security.createRole(roleName :: STRING?) :: VOID

admin

dbms.security.createUser()

Create a new user.

dbms.security.createUser(username :: STRING?, password :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID

admin

dbms.security.deleteRole()

Delete the specified role. Any role assignments will be removed.

dbms.security.deleteRole(roleName :: STRING?) :: VOID

admin

dbms.security.deleteUser()

Delete the specified user.

dbms.security.deleteUser(username :: STRING?) :: VOID

admin

dbms.security.listRoles()

List all available roles.

dbms.security.listRoles() :: (role :: STRING?, users :: LIST? OF STRING?)

admin

dbms.security.listRolesForUser()

List all roles assigned to the specified user.

dbms.security.listRolesForUser(username :: STRING?) :: (value :: STRING?)

admin

dbms.security.listUsers()

List all local users.

dbms.security.listUsers() :: (username :: STRING?, roles :: LIST? OF STRING?, flags :: LIST? OF STRING?)

admin

dbms.security.listUsersForRole()

List all users currently assigned the specified role.

dbms.security.listUsersForRole(roleName :: STRING?) :: (value :: STRING?)

admin

dbms.security.removeRoleFromUser()

Unassign a role from the user.

dbms.security.removeRoleFromUser(roleName :: STRING?, username :: STRING?) :: VOID

admin

dbms.security.showCurrentUser()

Show the current user. Deprecated by dbms.showCurrentUser.

dbms.security.showCurrentUser() :: (username :: STRING?, roles :: LIST? OF STRING?, flags :: LIST? OF STRING?)

reader, editor, publisher, architect, admin

dbms.security.suspendUser()

Suspend the specified user.

dbms.security.suspendUser(username :: STRING?) :: VOID

admin

dbms.setConfigValue()

Updates a given setting value. Passing an empty value will result in removing the configured value and falling back to the default value. Changes will not persist and will be lost if the server is restarted.

dbms.setConfigValue(setting :: STRING?, value :: STRING?) :: VOID

admin

dbms.setTXMetaData()

Attaches a map of data to the transaction. The data will be printed when listing queries, and inserted into the query log.

dbms.setTXMetaData(data :: MAP?) :: VOID

reader, editor, publisher, architect, admin

dbms.showCurrentUser()

Show the current user.

dbms.showCurrentUser() :: (username :: STRING?, roles :: LIST? OF STRING?, flags :: LIST? OF STRING?)

reader, editor, publisher, architect, admin

A.2.4. Community Edition procedures

Table A.261. Community Edition procedures
Name Description Signature

db.awaitIndex()

Wait for an index to come online (for example: CALL db.awaitIndex(":Person(name)")).

db.awaitIndex(index :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID

db.awaitIndexes()

Wait for all indexes to come online (for example: CALL db.awaitIndexes("500")).

db.awaitIndexes(timeOutSeconds = 300 :: INTEGER?) :: VOID

db.constraints()

List all constraints in the database.

db.constraints() :: (description :: STRING?)

db.createLabel()

Create a label

db.createLabel(newLabel :: STRING?) :: VOID

db.createProperty()

Create a Property

db.createProperty(newProperty :: STRING?) :: VOID

db.createRelationshipType()

Create a RelationshipType

db.createRelationshipType(newRelationshipType :: STRING?) :: VOID

db.index.explicit.addNode()

Add a node to an explicit index based on a specified key and value

db.index.explicit.addNode(indexName :: STRING?, node :: NODE?, key :: STRING?, value :: ANY?) :: (success :: BOOLEAN?)

db.index.explicit.addRelationship()

Add a relationship to an explicit index based on a specified key and value

db.index.explicit.addRelationship(indexName :: STRING?, relationship :: RELATIONSHIP?, key :: STRING?, value :: ANY?) :: (success :: BOOLEAN?)

db.index.explicit.auto.searchNodes()

Search nodes in explicit automatic index. Replaces START n=node:node_auto_index('key:foo*')

db.index.explicit.auto.searchNodes(query :: ANY?) :: (node :: NODE?, weight :: FLOAT?)

db.index.explicit.auto.searchRelationships()

Search relationship in explicit automatic index. Replaces START r=relationship:relationship_auto_index('key:foo*')

db.index.explicit.auto.searchRelationships(query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

db.index.explicit.auto.seekNodes()

Get node from explicit automatic index. Replaces START n=node:node_auto_index(key = 'A')

db.index.explicit.auto.seekNodes(key :: STRING?, value :: ANY?) :: (node :: NODE?)

db.index.explicit.auto.seekRelationships()

Get relationship from explicit automatic index. Replaces START r=relationship:relationship_auto_index(key = 'A')

db.index.explicit.auto.seekRelationships(key :: STRING?, value :: ANY?) :: (relationship :: RELATIONSHIP?)

db.index.explicit.drop()

Remove an explicit index - YIELD type,name,config

db.index.explicit.drop(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

db.index.explicit.existsForNodes()

Check if a node explicit index exists

db.index.explicit.existsForNodes(indexName :: STRING?) :: (success :: BOOLEAN?)

db.index.explicit.existsForRelationships()

Check if a relationship explicit index exists

db.index.explicit.existsForRelationships(indexName :: STRING?) :: (success :: BOOLEAN?)

db.index.explicit.forNodes()

Get or create a node explicit index - YIELD type,name,config

db.index.explicit.forNodes(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

db.index.explicit.forRelationships()

Get or create a relationship explicit index - YIELD type,name,config

db.index.explicit.forRelationships(indexName :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)

db.index.explicit.list()

List all explicit indexes - YIELD type,name,config

db.index.explicit.list() :: (type :: STRING?, name :: STRING?, config :: MAP?)

db.index.explicit.removeNode()

Remove a node from an explicit index with an optional key

db.index.explicit.removeNode(indexName :: STRING?, node :: NODE?, key :: STRING?) :: (success :: BOOLEAN?)

db.index.explicit.removeRelationship()

Remove a relationship from an explicit index with an optional key

db.index.explicit.removeRelationship(indexName :: STRING?, relationship :: RELATIONSHIP?, key :: STRING?) :: (success :: BOOLEAN?)

db.index.explicit.searchNodes()

Search nodes in explicit index. Replaces START n=node:nodes('key:foo*')

db.index.explicit.searchNodes(indexName :: STRING?, query :: ANY?) :: (node :: NODE?, weight :: FLOAT?)

db.index.explicit.searchRelationships()

Search relationship in explicit index. Replaces START r=relationship:relIndex('key:foo*')

db.index.explicit.searchRelationships(indexName :: STRING?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

db.index.explicit.searchRelationshipsBetween()

Search relationship in explicit index, starting at the node 'in' and ending at 'out'.

db.index.explicit.searchRelationshipsBetween(indexName :: STRING?, in :: NODE?, out :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

db.index.explicit.searchRelationshipsIn()

Search relationship in explicit index, starting at the node 'in'.

db.index.explicit.searchRelationshipsIn(indexName :: STRING?, in :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

db.index.explicit.searchRelationshipsOut()

Search relationship in explicit index, ending at the node 'out'.

db.index.explicit.searchRelationshipsOut(indexName :: STRING?, out :: NODE?, query :: ANY?) :: (relationship :: RELATIONSHIP?, weight :: FLOAT?)

db.index.explicit.seekNodes()

Get node from explicit index. Replaces START n=node:nodes(key = 'A')

db.index.explicit.seekNodes(indexName :: STRING?, key :: STRING?, value :: ANY?) :: (node :: NODE?)

db.index.explicit.seekRelationships()

Get relationship from explicit index. Replaces START r=relationship:relIndex(key = 'A')

db.index.explicit.seekRelationships(indexName :: STRING?, key :: STRING?, value :: ANY?) :: (relationship :: RELATIONSHIP?)

db.indexes()

List all indexes in the database.

db.indexes() :: (description :: STRING?, label :: STRING?, properties :: LIST? OF STRING?, state :: STRING?, type :: STRING?, provider :: MAP?)

db.labels()

List all labels in the database.

db.labels() :: (label :: STRING?)

db.propertyKeys()

List all property keys in the database.

db.propertyKeys() :: (propertyKey :: STRING?)

db.relationshipTypes()

List all relationship types in the database.

db.relationshipTypes() :: (relationshipType :: STRING?)

db.resampleIndex()

Schedule resampling of an index (for example: CALL db.resampleIndex(":Person(name)")).

db.resampleIndex(index :: STRING?) :: VOID

db.resampleOutdatedIndexes()

Schedule resampling of all outdated indexes.

db.resampleOutdatedIndexes() :: VOID

db.schema()

Show the schema of the data.

db.schema() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)

dbms.changePassword()

Change the current user’s password. Deprecated by dbms.security.changePassword.

dbms.changePassword(password :: STRING?) :: VOID

dbms.components()

List DBMS components and their versions.

dbms.components() :: (name :: STRING?, versions :: LIST? OF STRING?, edition :: STRING?)

dbms.functions()

List all user functions in the DBMS.

dbms.functions() :: (name :: STRING?, signature :: STRING?, description :: STRING?)

dbms.listConfig()

List the currently active config of Neo4j.

dbms.listConfig(searchString = :: STRING?) :: (name :: STRING?, description :: STRING?, value :: STRING?)

dbms.procedures()

List all procedures in the DBMS.

dbms.procedures() :: (name :: STRING?, signature :: STRING?, description :: STRING?)

dbms.queryJmx()

Query JMX management data by domain and name. For instance, "org.neo4j:*"

dbms.queryJmx(query :: STRING?) :: (name :: STRING?, description :: STRING?, attributes :: MAP?)

dbms.security.changePassword()

Change the current user’s password.

dbms.security.changePassword(password :: STRING?) :: VOID

dbms.security.createUser()

Create a new user.

dbms.security.createUser(username :: STRING?, password :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID

dbms.security.deleteUser()

Delete the specified user.

dbms.security.deleteUser(username :: STRING?) :: VOID

dbms.security.listUsers()

List all local users.

dbms.security.listUsers() :: (username :: STRING?, flags :: LIST? OF STRING?)

dbms.security.showCurrentUser()

Show the current user. Deprecated by dbms.showCurrentUser.

dbms.security.showCurrentUser() :: (username :: STRING?, flags :: LIST? OF STRING?)

dbms.showCurrentUser()

Show the current user.

dbms.showCurrentUser() :: (username :: STRING?, flags :: LIST? OF STRING?)