Reputation: 1432
Can we have multiple properties of a node to identify it uniquely in neo4j graph database?
Something like composite primary key, in RDBMS, to uniquely identify a row of a table.
Upvotes: 5
Views: 151
Reputation: 515
As of now, neo4j(v3.0.3) still does not support unique constraint with multiple properties. The reason behind this is: When a unique constraint is created it also creates an index on it and as indexes only allow one property, thus constraints can only be applied on one index.
Upvotes: 0
Reputation: 15076
You can use an array property and create index on that.
Upvotes: 4
Reputation: 10856
Unfortunately not. The best that you can do at the moment is to create a property which concatenates the properties that you want to uniquely identify and put a constraint on that.
Upvotes: 4