Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-20-2020 04:38 PM
Let's say I want to have a unique ID for each node, Student and Teacher, two labels. In creating the ID columns, can I use 'ID' for both Student and Teacher nodes, or I should use "Student_ID" and "Teacher_ID" for the two different types? I need to create constraints on each node by the ID.
04-20-2020 08:09 PM
It shouldn't be a problem to call the property ID
on both node types, since you define a constraint against a specific label:
CREATE CONSTRAINT constraint_name
ON (book:Book) ASSERT book.isbn IS UNIQUE
Just make sure that when using the index that gets created with the constraint, you specify the same label, otherwise it won't work. For example if both :Student
and :Teacher
nodes were also :Person
nodes, you wouldn't have access to the index when matching :Person
All the sessions of the conference are now available online