Creating Existence Constraints for Node properties
2.5 · Challenge

Creating Existence Constraints for Node properties

In our Movie Full 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 Full 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 Full 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 Full 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.