Creating Existence Constraints for Relationship Properties
2.7 · Challenge

Creating Existence Constraints for Relationship 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 RATED Full 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 Full 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 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 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: