James Newton
James Newton

Reputation: 7114

Neo4j constraints: UNIQUENESS only?

The Neo4j Manual page on Constraints shows the type of each constraint as UNIQUENESS. Is there any other kind of constraint that can be applied?

Upvotes: 0

Views: 85

Answers (2)

FylmTM
FylmTM

Reputation: 2007

Currently, in Neo4j stable version only UNIQUENESS constraint is supported.

But, in upcoming 2.3.0 release there will be new constraint added in Neo4j - PROPERTY EXISTS.

Example:

CREATE CONSTRAINT ON (book:Book) ASSERT exists(book.isbn)
CREATE CONSTRAINT ON ()-[like:LIKED]-() ASSERT exists(like.day)

Docs for new constraint can be found in 2.3.0-M03 release documentation - http://neo4j.com/docs/2.3.0-M03/query-constraints.html
Also, you can checkout blog post by Neo where new constraints are presented - http://neo4j.com/blog/neo4j-2-3-milestone-3-release/

Note: new contraint will be available only for Enterprise version.

Upvotes: 1

William Lyon
William Lyon

Reputation: 8556

No, currently the only type of constraint available is uniqueness.

Upvotes: 0

Related Questions