cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Constraints Exists

what is difference between is not null and exists constraint in neo4j are they same also was trying to create below but getting error :

Invalid input 'n': expected whitespace, comment or UNIQUE (line 1, column 70 (offset: 69))
"CREATE CONSTRAINT constraint_name ON (book:Book) ASSERT book.isbn is not null"

Any guess why its giving error

1 ACCEPTED SOLUTION

Yes, you're right. they are equivalent.
It's just a matter of syntax. that is, up to neo4j 4.2, the syntax with "IS NOT NULL" was not interpreted by cypher.
Since version 4.3 this syntax has been added, as you can see here:

Obviously "IS NOT NULL" and "exists" coincide.

View solution in original post

1 REPLY 1

Yes, you're right. they are equivalent.
It's just a matter of syntax. that is, up to neo4j 4.2, the syntax with "IS NOT NULL" was not interpreted by cypher.
Since version 4.3 this syntax has been added, as you can see here:

Obviously "IS NOT NULL" and "exists" coincide.