Neo4j - Restriction on existence

I am trying to have such a restriction that any node labeled "Users" must have certain properties (for example, username, password, etc.)

When trying CREATE CONSTRAINT ON (u:Users) ASSERT exists(u.username) We get an error message: Could not create CONSTRAINT ON ( users:Users ) ASSERT exists(users.username) Neo.DatabaseError.Schema.ConstraintCreationFailure

This command was taken from official 2.3.2 documents, and the command was launched from the browser interface.

So what am I doing wrong? In addition, is it recommended to store user confidential information in neo4j?

Thanks.

+7
java neo4j constraints
source share
2 answers

Property restrictions are part of the Enterprise version of Neo4j and do not exist in the Community version. There is a field in the documentation that states http://neo4j.com/docs/stable/query-constraints.html .

+5
source share

I agree, very disappointing. This is a basic function that changes the behavior of an application and makes it impossible to move databases between releases. Exists () is not a corporate function, it is a normal function. Until this is fixed, Neo4j should inform the user in the server response when the creation of the constraint fails, that it is an Enterprise feature.

+2
source share

All Articles