문제

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