Creating Existence Constraints for Node 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 Movie in the graph has a value for its title iFull definition for property (opens in a new tab)A named value stored on a node or a relationship. and every User has a value for the name property. In your real application, you would create 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 iFull definition for node (opens in a new tab)A vertex in a graph. In a property graph it can carry labels and properties. prior to loading the data. For this course, we already have the data loaded, but we still want to constrain the graph so that all movies have titles and all users have names.
In the previous lesson, you executed code to create an existence constraint for the Person nodes to ensure they always have a value for the name property.
In this Challenge, you will create two more uniqueness 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