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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top