apoc.schema.nodes

Procedure

apoc.schema.nodes(config Map<String, Any>) - returns all indexes and constraints information for all node labels in the database. It is possible to define a set of labels to include or exclude in the config parameters.

Signature

apoc.schema.nodes(config = {} :: MAP?) :: (name :: STRING?, label :: ANY?, properties :: LIST? OF STRING?, status :: STRING?, type :: STRING?, failure :: STRING?, populationProgress :: FLOAT?, size :: INTEGER?, valuesSelectivity :: FLOAT?, userDescription :: STRING?)

Input parameters

Name Type Default

config

MAP?

{}

Output parameters

Name Type

name

STRING?

label

ANY?

properties

LIST? OF STRING?

status

STRING?

type

STRING?

failure

STRING?

populationProgress

FLOAT?

size

INTEGER?

valuesSelectivity

FLOAT?

userDescription

STRING?

Usage Examples

The examples in this section are based on a database that has applied the following constraints:

CREATE CONSTRAINT personName FOR (person:Person)
REQUIRE person.name IS UNIQUE;

CREATE CONSTRAINT userId FOR (user:User)
REQUIRE user.id IS UNIQUE;
CALL apoc.schema.nodes();
Table 1. Results
name label properties status type failure populationProgress size valuesSelectivity userDescription

":Person(name)"

"Person"

["name"]

"ONLINE"

"UNIQUENESS"

"NO FAILURE"

100.0

7

1.0

"Index( id=1, name='personName', type='UNIQUE RANGE', schema=(:Person {name}), indexProvider='native-btree-1.0' )"

":User(id)"

"User"

["id"]

"ONLINE"

"UNIQUENESS"

"NO FAILURE"

100.0

0

1.0

"Index( id=3, name='userId', type='UNIQUE RANGE', schema=(:User {id}), indexProvider='native-btree-1.0' )"