Neoecos
Neoecos

Reputation: 579

Creation of compund unique contraint in neo4j 2.0

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.

Upvotes: 1

Views: 151

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39925

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.

Upvotes: 4

Related Questions