Creating Existence Constraints for Relationship Properties
In our Movie iFull definition for data model (opens in a new tab)The labels, relationship types and properties chosen to represent a domain., we want to ensure every RATED iFull definition for relationship (opens in a new tab)A named, directed connection between two nodes. Every relationship has a type, a start node and an end node. has values for the rated and timestamp iFull definition for property (opens in a new tab)A named value stored on a node or a relationship..
In the previous lesson, you created the existence iFull definition for constraint (opens in a new tab)A rule the database enforces on every node or relationship with a given label or type, rejecting any write that breaks it. for the rating property for the RATED relationships in the graph.
Create the existence constraint for the timestamp property of the RATED relationships.
In the sandbox on the right, modify the code to create this existence constraints in the graph:
Join GraphAcademy to keep learning
Create your account to unlock 80+ hours of hands-on Neo4j courses, track your progress, and earn a certificate when you complete the course.
Sign in or register