johnsonfoo / fyp-java-spring-data-neo4j

Spring Boot Application using Spring Data Neo4j for querying data stored in Neo4j
2 stars 0 forks source link

Add Neo4j cypher script for creating unique name constraint for nodes #104

Closed johnsonfoo closed 2 years ago

johnsonfoo commented 2 years ago

Unique property constraints ensure that property values are unique for all nodes with a specific label. For unique property constraints on multiple properties, the combination of the property values is unique. Unique constraints do not require all nodes to have a unique value for the properties listed — nodes without all properties are not subject to this rule.

Source

Introduce constraint for node labels (FQN, ClassFQN, MethodFQN) to have unique property name.

This will produce a side effect of creating indexes on property name for node labels (FQN, ClassFQN, MethodFQN).

johnsonfoo commented 2 years ago

To run the script provided:

CALL apoc.cypher.runSchemaFile('file:///scripts/create_constraint.cypher');