Skip to content

Commit 6357b44

Browse files
committed
Update documentation to reflect description of GQL error 22N31
1 parent 008cd1a commit 6357b44

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

modules/ROOT/pages/errors/gql-errors/22N31.adoc

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,50 @@
22

33

44
== Status description
5-
error: data exception - invalid properties in merge pattern. `MERGE` cannot be used with graph element property values that are null or NaN.
5+
error: data exception - invalid properties in merge pattern. The { <<entityType>> } property { <<propKey>> } in { <<pat>> } is invalid. `MERGE` cannot be used with a graph element property value that is { <<value>> }.
6+
7+
== Explanation
8+
This error occurs when a `MERGE` pattern includes a node or relationship property value that is not allowed, such as `null` or `NaN`.
9+
Because `MERGE` must be able to match or create a concrete graph element, these invalid values are rejected.
10+
11+
== Example scenarios
12+
13+
Let's take the following example scenarios:
14+
15+
=== Null property value in a `MERGE` pattern
16+
For example, try to merge a node with a `null` property value as follows:
17+
18+
[source,cypher]
19+
----
20+
MERGE (p:Person {age: null})
21+
----
22+
23+
The query returns an error with GQLSTATUS 22N31 and the status description:
24+
25+
[source]
26+
----
27+
error: data exception - invalid properties in merge pattern. 'MERGE' cannot be used with graph element property values that are null. For node property 'age' in '(:Person {age: null})'.
28+
----
29+
30+
In this case, provide a concrete value for the property, or remove it from the `MERGE` pattern.
31+
32+
=== NaN property value in a `MERGE` pattern
33+
For example, try to merge a relationship with a `NaN` property value as follows:
34+
35+
[source,cypher]
36+
----
37+
WITH 0.0/0.0 AS nan
38+
MERGE (a:Person)-[:KNOWS {score: nan}]->(b:Person)
39+
----
40+
41+
The query returns an error with GQLSTATUS 22N31 and the status description:
42+
43+
[source]
44+
----
45+
error: data exception - invalid properties in merge pattern. 'MERGE' cannot be used with graph element property values that are NaN. For relationship property 'score' in '(:Person)-[:KNOWS {score: NaN}]->(:Person)'.
46+
----
47+
48+
In this case, provide a numeric value for the property, or remove it from the `MERGE` pattern.
649

750

851
ifndef::backend-pdf[]

0 commit comments

Comments
 (0)