Creation of compund unique contraint in neo4j 2.0

157 Views Asked by At

i'm using neo4j to create a versioned graph database, and i'm having some troubles to implement unique constraints in the database.

I want to know if is possible to do something like

CREATE CONSTRAINT ON (u:CaliopeUser) ASSERT u.timestampt+u.name IS UNIQUE

Or any other idea about how to implenment the uniqueness constraint in neo4j for a versioned database.

1

There are 1 best solutions below

1
On BEST ANSWER

In 2.0 compound schema indexes are not possible. The recommended workaround is to create another property holding the compound value (maybe a transactionEventHandler might help with automating this) and use a index on that property.

I expect support for indexes on compound properties in some future release.