From 10b47ba25a8d40911d61fff400160a8c4ffd58e0 Mon Sep 17 00:00:00 2001 From: Harsh Gupta Date: Tue, 3 Feb 2026 15:21:18 +0000 Subject: [PATCH 1/3] SURF-537 Update documentation for type mismatch errors https://linear.app/neo4j/issue/SURF-537/better-error-message-for-queries-like-match-a-b-set-a-=-b --- .../ROOT/pages/errors/gql-errors/22N27.adoc | 21 ++++++++++++++++++- .../ROOT/pages/errors/gql-errors/index.adoc | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/pages/errors/gql-errors/22N27.adoc b/modules/ROOT/pages/errors/gql-errors/22N27.adoc index 8ea732bf..8e988167 100644 --- a/modules/ROOT/pages/errors/gql-errors/22N27.adoc +++ b/modules/ROOT/pages/errors/gql-errors/22N27.adoc @@ -1,7 +1,26 @@ = 22N27 == Status description -error: data exception - invalid entity type. Invalid input `{ <> }` for `{ <> }`. Expected to be `{ <> }`. +error: data exception - invalid entity type. Invalid input `{ <> }` for `{ <> }`. Expected to be `{ <> }` `{ <> }`. + +[NOTE] +==== +The `{ <> }` segment is optional. When present, it contains additional guidance (for example: `Hint: use properties(...) on the right-hand side.`). +==== + +== Example scenario +When a query expects a map but receives a node or relationship, the error can surface with an optional hint: + +``` +MATCH (a)-->(b) +SET a = b +``` + +Resulting status description: + +``` +error: data exception - invalid entity type. Invalid input `RELATIONSHIP` for `b`. Expected to be `MAP`. Hint: use properties(...) on the right-hand side. +``` ifndef::backend-pdf[] diff --git a/modules/ROOT/pages/errors/gql-errors/index.adoc b/modules/ROOT/pages/errors/gql-errors/index.adoc index 0a143b65..bdcfd595 100644 --- a/modules/ROOT/pages/errors/gql-errors/index.adoc +++ b/modules/ROOT/pages/errors/gql-errors/index.adoc @@ -266,7 +266,7 @@ Status description:: error: data exception - unsupported rounding mode. Unknown === xref:errors/gql-errors/22N27.adoc[22N27] -Status description:: error: data exception - invalid entity type. Invalid input `{ <> }` for `{ <> }`. Expected to be `{ <> }`. +Status description:: error: data exception - invalid entity type. Invalid input `{ <> }` for `{ <> }`. Expected to be `{ <> }` `{ <> }`. === xref:errors/gql-errors/22N28.adoc[22N28] From 96ee0194dfb1ad9614c49e7ec8f09f9eb2b5f269 Mon Sep 17 00:00:00 2001 From: Reneta Popova Date: Mon, 9 Feb 2026 17:08:22 +0000 Subject: [PATCH 2/3] editorial review of the example, add a solution --- .../ROOT/pages/errors/gql-errors/22N27.adoc | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/errors/gql-errors/22N27.adoc b/modules/ROOT/pages/errors/gql-errors/22N27.adoc index 8e988167..7288dca7 100644 --- a/modules/ROOT/pages/errors/gql-errors/22N27.adoc +++ b/modules/ROOT/pages/errors/gql-errors/22N27.adoc @@ -9,18 +9,31 @@ The `{ <> }` segment is optional. When present, it contains additional gui ==== == Example scenario -When a query expects a map but receives a node or relationship, the error can surface with an optional hint: -``` +For example, consider the following query, which expects a map but receives a node or relationship: + +[source,cypher] +---- MATCH (a)-->(b) SET a = b -``` +---- -Resulting status description: +You will receive an error with GQLSTATUS 22N27 and status description: -``` +[source] +---- error: data exception - invalid entity type. Invalid input `RELATIONSHIP` for `b`. Expected to be `MAP`. Hint: use properties(...) on the right-hand side. -``` +---- + +== Possible solution + +To resolve this error, ensure that the input for `b` is a map. You can modify the query as follows: + +[source,cypher] +---- +MATCH (a)-->(b) +SET a = properties(b) +---- ifndef::backend-pdf[] From 8be2ba3715019935b399cd5f1feb15102ae9552f Mon Sep 17 00:00:00 2001 From: Reneta Popova Date: Tue, 10 Feb 2026 10:50:55 +0000 Subject: [PATCH 3/3] prepend the queries with the correct Cypher version and add labels --- modules/ROOT/pages/errors/gql-errors/22N27.adoc | 2 ++ .../pages/notifications/all-notifications.adoc | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/errors/gql-errors/22N27.adoc b/modules/ROOT/pages/errors/gql-errors/22N27.adoc index 7288dca7..22e2675e 100644 --- a/modules/ROOT/pages/errors/gql-errors/22N27.adoc +++ b/modules/ROOT/pages/errors/gql-errors/22N27.adoc @@ -14,6 +14,7 @@ For example, consider the following query, which expects a map but receives a no [source,cypher] ---- +CYPHER 25 MATCH (a)-->(b) SET a = b ---- @@ -31,6 +32,7 @@ To resolve this error, ensure that the input for `b` is a map. You can modify th [source,cypher] ---- +CYPHER 25 MATCH (a)-->(b) SET a = properties(b) ---- diff --git a/modules/ROOT/pages/notifications/all-notifications.adoc b/modules/ROOT/pages/notifications/all-notifications.adoc index 2051a99f..df4ebf42 100644 --- a/modules/ROOT/pages/notifications/all-notifications.adoc +++ b/modules/ROOT/pages/notifications/all-notifications.adoc @@ -1892,6 +1892,7 @@ MATCH (a)-[:A|B|C]-() RETURN * ====== ===== +[role=label--cypher-5] .Setting properties using a node [.tabbed-example] ===== @@ -1901,6 +1902,7 @@ Query:: + [source,cypher] ---- +CYPHER 5 MATCH (a)-[]-(b) SET a = b ---- @@ -1918,6 +1920,7 @@ Use the `properties()` function to get all properties from `b`. + [source,cypher] ---- +CYPHER 5 MATCH (a)-[]-(b) SET a = properties(b) ---- @@ -1949,7 +1952,7 @@ SET a = properties(b) ====== ===== - +[role=label--cypher-5] .Setting properties using a relationship [.tabbed-example] ===== @@ -1959,6 +1962,7 @@ Query:: + [source,cypher] ---- +CYPHER 5 MATCH (a)-[r]-(b) SET a += r ---- @@ -1976,6 +1980,7 @@ Use the `properties()` function to get all properties from `r`. + [source,cypher] ---- +CYPHER 5 MATCH (a)-[r]-(b) SET a += properties(r) ---- @@ -2990,7 +2995,7 @@ m|Neo.ClientNotification.Request.FeatureDeprecationWarning |Title a|This feature is deprecated and will be removed in future versions. |Description -a| +a| `%s` is deprecated. It is replaced by `%s`. |Category m|DEPRECATION @@ -4495,7 +4500,7 @@ The requested topology matched the current topology. No allocations were changed ====== ===== -[role=label--new-2025.01 label--Cypher25] +[role=label--new-2025.01 label--cypher-25] [#_neo_clientnotification_cluster_servercaughtup] === Server has caught up during `WAIT` command @@ -4565,7 +4570,7 @@ Server `ServerId\{0e020000}` at address `localhost:20026` has caught up. ====== ===== -[role=label--new-2025.01 label--Cypher25] +[role=label--new-2025.01 label--cypher-25] [#_neo_clientnotification_cluster_serverfailed] === Server failed during `WAIT` command @@ -4642,7 +4647,7 @@ Investigate the failing server using the provided message. ====== ===== -[role=label--new-2025.01 label--Cypher25] +[role=label--new-2025.01 label--cypher-25] [#_neo_clientnotification_cluster_servercatchingup] === Server is still catching up during `WAIT` command @@ -4720,7 +4725,7 @@ Investigate the server and network for performance issues or increase the wait t ====== ===== -[role=label--new-2025.01 label--Cypher25] +[role=label--new-2025.01 label--cypher-25] [#_neo_clientnotification_cluster_serverunavailable] === Server is not available during `WAIT` command