apoc.export.cypher.schema
Procedure
apoc.export.cypher.schema(file String, config Map<String, Any>)
- exports all schema indexes and constraints to Cypher statements.
Signature
apoc.export.cypher.schema(file = :: STRING?, config = {} :: MAP?) :: (file :: STRING?, batches :: INTEGER?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?, batchSize :: INTEGER?, cypherStatements :: STRING?, nodeStatements :: STRING?, relationshipStatements :: STRING?, schemaStatements :: STRING?, cleanupStatements :: STRING?)
Output parameters
Name | Type |
---|---|
file |
STRING? |
batches |
INTEGER? |
source |
STRING? |
format |
STRING? |
nodes |
INTEGER? |
relationships |
INTEGER? |
properties |
INTEGER? |
time |
INTEGER? |
rows |
INTEGER? |
batchSize |
INTEGER? |
cypherStatements |
STRING? |
nodeStatements |
STRING? |
relationshipStatements |
STRING? |
schemaStatements |
STRING? |
cleanupStatements |
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.export.cypher.schema()
YIELD format, time, cypherStatements
RETURN format, time, cypherStatements;
format | time | cypherStatements |
---|---|---|
"cypher" |
1 |
":begin CREATE CONSTRAINT FOR (node:Person) REQUIRE (node.name) IS UNIQUE; CREATE CONSTRAINT FOR (node:User) REQUIRE (node.id) IS UNIQUE; :commit CALL db.awaitIndexes(300); " |
Was this page helpful?