You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to define a constraint against a node that is not using an alias, such as `:Node`, will cause this error.
8
+
The constraint must be defined against an element type alias, for example, `n:Node`.
9
+
10
+
== Example scenario
11
+
Attempt to define an existance constraint as follows:
12
+
13
+
[source,cypher]
14
+
----
15
+
ALTER CURRENT GRAPH TYPE SET {
16
+
CONSTRAINT FOR (:Node) REQUIRE n.prop IS NOT NULL
17
+
}
18
+
----
19
+
20
+
An error will be thrown with GQLSTATUS 22NCB and the status description:
21
+
22
+
[source]
23
+
----
24
+
error: data exception - invalid element type constraints in graph type. A node element type property existence constraint cannot be specified inline of a node element type.
25
+
----
26
+
27
+
A correct definition is as follows:
28
+
29
+
[source, cypher]
30
+
----
31
+
ALTER CURRENT GRAPH TYPE SET {
32
+
CONSTRAINT FOR (n:Node) REQUIRE n.prop IS NOT NULL
0 commit comments