Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top