The following can be used to extract index defintions and constraint defintions from an existing database and the resultant output can be played back on another Neo4j database.

To extract Cypher CREATE INDEX statements run:

CALL db.indexes() YIELD description
RETURN 'CREATE ' + description

To extract Cypher CREATE CONSTRAINT statements run:

CALL db.constraints() YIELD description
RETURN 'CREATE ' + description

Details


Author:
Dana Canzano
Applicable versions:
3.0.
Keywords:
constraintcypherindexneo4j-3.0.