Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-04-2020 10:21 AM
Hi,
I am trying to run following cypher via Neo4j browser
CREATE CONSTRAINT test_id IF NOT EXISTS ON (n:Test) ASSERT n.id IS UNIQUE
it is giving following error
Invalid input 'I': expected whitespace, comment or ON (line 1, column 27 (offset: 26))
"CREATE CONSTRAINT test_id IF NOT EXISTS ON (n:Test) ASSERT n.id IS UNIQUE"
Thanks
Solved! Go to Solution.
11-04-2020 10:55 AM
@sethia.arun hi I think maybe you are running in the community edition and know those kind of sentences only works in enterprise edition https://neo4j.com/docs/cypher-manual/current/administration/constraints/
11-04-2020 10:55 AM
@sethia.arun hi I think maybe you are running in the community edition and know those kind of sentences only works in enterprise edition https://neo4j.com/docs/cypher-manual/current/administration/constraints/
11-04-2020 11:23 AM
Thanks, yes I am using community edition.
12-23-2020 03:37 AM
I am getting the same error.
From reading that documentation it does seem like most constraints are limited to enterprise edition but not this "unique node property constraint". So this query should work in community edition?
Also, even if it was limited to enterprise edition, I am currently testing using neo4j desktop which afaik is equivalent to enterprise edition and should therefore work even then.
12-23-2020 03:48 AM
Ah I found this in the documentation for 4.1 (I'm running 4.1.0)
The
IF [NOT] EXISTS
syntax for constraints is only available in Neo4j 4.1.3 and onwards.
All the sessions of the conference are now available online