Skip to content

Commit 7795ae2

Browse files
committed
add neo4j code examples and fix the tabs
1 parent adcee9f commit 7795ae2

File tree

1 file changed

+270
-2
lines changed

1 file changed

+270
-2
lines changed

modules/ROOT/pages/notifications/all-notifications.adoc

Lines changed: 270 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,9 +2021,33 @@ warn: feature deprecated without replacement.
20212021
======
20222022
=====
20232023

2024-
.Using an unescaped variable named 'where' in node or relationship patterns
2024+
.Using an unescaped variable named 'where' in node
20252025
[.tabbed-example]
20262026
=====
2027+
[.include-with-neo4j-code]
2028+
======
2029+
2030+
Query::
2031+
+
2032+
[source,cypher]
2033+
----
2034+
MATCH (where {p: 5})
2035+
RETURN where
2036+
----
2037+
2038+
Description of the returned code::
2039+
`(where {p: 5})` is deprecated. It is replaced by `(++`where`++ {p: 5})`.
2040+
2041+
Suggestions for improvement::
2042+
To continue using variables with this name, use backticks to escape the variable name:
2043+
+
2044+
[source,cypher]
2045+
----
2046+
MATCH (`where` {p: 5})
2047+
RETURN `where`.p
2048+
----
2049+
======
2050+
20272051
[.include-with-GQLSTATUS-deprecated-with-replacement]
20282052
======
20292053
Query::
@@ -2051,6 +2075,34 @@ MATCH (`where` {p: 5})
20512075
RETURN `where`.p
20522076
----
20532077
======
2078+
=====
2079+
2080+
.Using an unescaped variable named 'where' in relationship patterns
2081+
[.tabbed-example]
2082+
=====
2083+
[.include-with-neo4j-code]
2084+
======
2085+
Query::
2086+
+
2087+
[source,cypher]
2088+
----
2089+
MATCH ()-[where {p: 5}]->()
2090+
RETURN where
2091+
----
2092+
2093+
Description of the returned code::
2094+
`-[where {p: 5}]-` is deprecated. It is replaced by `-[++`where`++ {p: 5}]-`.
2095+
2096+
Suggestions for improvement::
2097+
To continue using variables with this name, use backticks to escape the variable name:
2098+
+
2099+
[source,cypher]
2100+
----
2101+
MATCH ()-[`where` {p: 5}]->()
2102+
RETURN `where`.p
2103+
----
2104+
======
2105+
20542106
[.include-with-GQLSTATUS-deprecated-with-replacement]
20552107
======
20562108
Query::
@@ -2083,6 +2135,31 @@ RETURN `where`.p
20832135
.Using an unparenthesized label expression predicate as the right-hand side operand of `+`
20842136
[.tabbed-example]
20852137
=====
2138+
[.include-with-neo4j-code]
2139+
======
2140+
Query::
2141+
+
2142+
[source,cypher]
2143+
----
2144+
MATCH (n)-[r]->(m)
2145+
WITH m, n.truthCodes AS listOfBooleans
2146+
RETURN listOfBooleans + m:A
2147+
----
2148+
2149+
Description of the returned code::
2150+
`... + m:A` is deprecated. It is replaced by `... + (m:A)`.
2151+
2152+
Suggestions for improvement::
2153+
Parenthesize the label expression predicate on the right-hand side of `+`:
2154+
+
2155+
[source,cypher]
2156+
----
2157+
MATCH (n)-[r]->(m)
2158+
WITH m, n.truthCodes AS listOfBooleans
2159+
RETURN listOfBooleans + (m:A)
2160+
----
2161+
======
2162+
20862163
[.include-with-GQLSTATUS-deprecated-with-replacement]
20872164
======
20882165
Query::
@@ -2112,6 +2189,36 @@ WITH m, n.truthCodes AS listOfBooleans
21122189
RETURN listOfBooleans + (m:A)
21132190
----
21142191
======
2192+
=====
2193+
2194+
.Using an unparenthesized label expression predicate as the right-hand side operand of `+`
2195+
[.tabbed-example]
2196+
=====
2197+
[.include-with-neo4j-code]
2198+
======
2199+
Query::
2200+
+
2201+
[source,cypher]
2202+
----
2203+
MATCH (n)-[r]->(m)
2204+
WITH r, n.truthCodes AS listOfBooleans
2205+
RETURN listOfBooleans + r:C|D
2206+
----
2207+
2208+
Description of the returned code::
2209+
`... + r:C|D` is deprecated. It is replaced by `... + (r:C|D)`.
2210+
2211+
Suggestions for improvement::
2212+
Parenthesize the label expression predicate on the right-hand side of `+`:
2213+
+
2214+
[source,cypher]
2215+
----
2216+
MATCH (n)-[r]->(m)
2217+
WITH r, n.truthCodes AS listOfBooleans
2218+
RETURN listOfBooleans + (r:C|D)
2219+
----
2220+
======
2221+
21152222
[.include-with-GQLSTATUS-deprecated-with-replacement]
21162223
======
21172224
Query::
@@ -2146,6 +2253,36 @@ RETURN listOfBooleans + (r:C|D)
21462253
.Using an unescaped variable named `is` as a `WHEN` operand in a simple `CASE` expression
21472254
[.tabbed-example]
21482255
=====
2256+
[.include-with-neo4j-code]
2257+
======
2258+
Query::
2259+
+
2260+
[source,cypher]
2261+
----
2262+
MATCH (n)
2263+
WITH n, n.internationalStandard AS is
2264+
RETURN CASE n
2265+
WHEN is :: INTEGER THEN "ISO/IEC" + is
2266+
ELSE is
2267+
END AS standardsName
2268+
----
2269+
2270+
Description of the returned code::
2271+
`WHEN is :: INTEGER` is deprecated. It is replaced by `WHEN ++`is`++ :: INTEGER`.
2272+
2273+
Suggestions for improvement::
2274+
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name:
2275+
+
2276+
[source,cypher]
2277+
----
2278+
MATCH (n)
2279+
WITH n, n.internationalStandard AS `is`
2280+
RETURN CASE n
2281+
WHEN `is` :: INTEGER THEN "ISO/IEC" + `is`
2282+
ELSE `is`
2283+
END AS standardsName
2284+
----
2285+
======
21492286
[.include-with-GQLSTATUS-deprecated-with-replacement]
21502287
======
21512288
Query::
@@ -2183,9 +2320,39 @@ END AS standardsName
21832320
======
21842321
=====
21852322

2186-
.Using an unescaped variable named `contains` in addition or subtraction operations within a `WHEN` operand in a simple `CASE` expression
2323+
.Using an unescaped variable named `contains` for relationships in addition or subtraction operations within a `WHEN` operand in a simple `CASE` expression
21872324
[.tabbed-example]
21882325
=====
2326+
[.include-with-neo4j-code]
2327+
======
2328+
Query::
2329+
+
2330+
[source,cypher]
2331+
----
2332+
MATCH p = (:A)-[:HAS]->(:B)
2333+
WITH p, size(relationships(p)) AS contains
2334+
RETURN CASE size(nodes(p))
2335+
WHEN contains + 1 THEN "okay"
2336+
ELSE "not okay"
2337+
END AS check
2338+
----
2339+
2340+
Description of the returned code::
2341+
`WHEN contains + 1 INTEGER` is deprecated. It is replaced by `WHEN ++`contains`++ + 1 INTEGER`.
2342+
2343+
Suggestions for improvement::
2344+
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name:
2345+
+
2346+
[source,cypher]
2347+
----
2348+
MATCH p = (:A)-[:HAS]->(:B)
2349+
WITH p, size(relationships(p)) AS `contains`
2350+
RETURN CASE size(nodes(p))
2351+
WHEN `contains` + 1 THEN "okay"
2352+
ELSE "not okay"
2353+
END AS check
2354+
----
2355+
======
21892356
[.include-with-GQLSTATUS-deprecated-with-replacement]
21902357
======
21912358
Query::
@@ -2221,6 +2388,42 @@ RETURN CASE size(nodes(p))
22212388
END AS check
22222389
----
22232390
======
2391+
=====
2392+
2393+
.Using an unescaped variable named `contains` for nodes in addition or subtraction operations within a `WHEN` operand in a simple `CASE` expression
2394+
[.tabbed-example]
2395+
=====
2396+
[.include-with-neo4j-code]
2397+
======
2398+
Query::
2399+
+
2400+
[source,cypher]
2401+
----
2402+
MATCH p = (:A)-[:HAS]->(:B)
2403+
WITH p, size(nodes(p)) AS contains
2404+
RETURN CASE size(relationships(p))
2405+
WHEN contains - 1 THEN "okay"
2406+
ELSE "not okay"
2407+
END AS check
2408+
----
2409+
2410+
Description of the returned code::
2411+
2412+
`WHEN contains - 1 INTEGER` is deprecated. It is replaced by `WHEN ++`contains`++ - 1 INTEGER`.
2413+
2414+
Suggestions for improvement::
2415+
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name:
2416+
+
2417+
[source,cypher]
2418+
----
2419+
MATCH p = (:A)-[:HAS]->(:B)
2420+
WITH p, size(nodes(p)) AS `contains`
2421+
RETURN CASE size(relationships(p))
2422+
WHEN `contains` - 1 THEN "okay"
2423+
ELSE "not okay"
2424+
END AS check
2425+
----
2426+
======
22242427
[.include-with-GQLSTATUS-deprecated-with-replacement]
22252428
======
22262429
Query::
@@ -2261,6 +2464,37 @@ END AS check
22612464
.Using the `[]` operator on an unescaped variable named `in` within a `WHEN` operand in a simple `CASE` expression
22622465
[.tabbed-example]
22632466
=====
2467+
[.include-with-neo4j-code]
2468+
======
2469+
Query::
2470+
+
2471+
[source,cypher]
2472+
----
2473+
MATCH (c:Client)-[:MAKES]->(t:Transaction)
2474+
WITH t, c.ibanNumbers AS in
2475+
RETURN CASE t.ibanNumber
2476+
WHEN in[0] THEN "used main account"
2477+
ELSE "used different account"
2478+
END AS check
2479+
----
2480+
2481+
Description of the returned code::
2482+
2483+
`WHEN in[0] INTEGER` is deprecated. It is replaced by `WHEN ++`in`++[0] INTEGER`.
2484+
2485+
Suggestions for improvement::
2486+
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name:
2487+
+
2488+
[source,cypher]
2489+
----
2490+
MATCH (c:Client)-[:MAKES]->(t:Transaction)
2491+
WITH t, c.ibanNumbers AS `in`
2492+
RETURN CASE t.ibanNumber
2493+
WHEN `in`[0] THEN "used main account"
2494+
ELSE "used different account"
2495+
END AS check
2496+
----
2497+
======
22642498
[.include-with-GQLSTATUS-deprecated-with-replacement]
22652499
======
22662500
Query::
@@ -2296,6 +2530,40 @@ RETURN CASE t.ibanNumber
22962530
END AS check
22972531
----
22982532
======
2533+
=====
2534+
2535+
.Using the `[]` operator on an unescaped variable named `in` within a `WHEN` operand in a simple `CASE` expression
2536+
[.tabbed-example]
2537+
=====
2538+
[.include-with-neo4j-code]
2539+
======
2540+
Query::
2541+
+
2542+
[source,cypher]
2543+
----
2544+
MATCH (in:Client)-[:MAKES]->(t:Transaction)
2545+
RETURN CASE t.ibanNumber
2546+
WHEN in["mainAccount"] THEN "used main account"
2547+
ELSE "used different account"
2548+
END AS check
2549+
----
2550+
2551+
Description of the returned code::
2552+
2553+
`WHEN in["mainAccount"] INTEGER` is deprecated. It is replaced by `WHEN ++`in`++["mainAccount"] INTEGER`.
2554+
2555+
Suggestions for improvement::
2556+
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name:
2557+
+
2558+
[source,cypher]
2559+
----
2560+
MATCH (in:Client)-[:MAKES]->(t:Transaction)
2561+
RETURN CASE t.ibanNumber
2562+
WHEN `in`["mainAccount"] THEN "used main account"
2563+
ELSE "used different account"
2564+
END AS check
2565+
----
2566+
======
22992567
[.include-with-GQLSTATUS-deprecated-with-replacement]
23002568
======
23012569
Query::

0 commit comments

Comments
 (0)