Skip to content

Commit 87a4805

Browse files
committed
Allow for parameters in SHORTEST
1 parent a6d1374 commit 87a4805

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,26 @@ MATCH (n)-[r:REL]->(m) SET n = properties(r)
9393
| Feature
9494
| Details
9595

96+
a|
97+
label:functionality[]
98+
label:updated[]
99+
[source, cypher, role=noheader]
100+
----
101+
MATCH SHORTEST $param (:A)-[:R]->{0,10}(:B)
102+
----
103+
104+
[source, cypher, role=noheader]
105+
----
106+
MATCH p = ANY $param (:A)-[:R]->{0,10}(:B)
107+
----
108+
109+
[source, cypher, role=noheader]
110+
----
111+
MATCH SHORTEST $param GROUPS (:A)-[:R]->{0,10}(:B)
112+
----
113+
114+
a| Introduced the allowance of parameters to the xref:patterns/shortest-paths.adoc[SHORTEST and ANY path patterns].
115+
96116
a|
97117
label:functionality[]
98118
label:updated[]

modules/ROOT/pages/patterns/reference.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,10 +1165,10 @@ anyPathSearch ::= "ANY" [ numberOfPaths ] [ pathOrPaths ]
11651165
pathOrPaths ::= { "PATH" | "PATHS" }
11661166
11671167
1168-
numberOfPaths ::= unsignedDecimalInteger
1168+
numberOfPaths ::= unsignedDecimalInteger | parameter
11691169
11701170
1171-
numberOfGroups ::= unsignedDecimalInteger
1171+
numberOfGroups ::= unsignedDecimalInteger | parameter
11721172
----
11731173

11741174
[NOTE]

modules/ROOT/pages/patterns/shortest-paths.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use Cypher if:
1919

2020
* You need to specify complex graph navigation via xref:patterns/variable-length-patterns.adoc#quantified-path-patterns[quantified path patterns].
2121
* Creating a link:https://neo4j.com/docs/graph-data-science/current/management-ops/graph-creation/graph-project/[graph projection] takes too long.
22-
* GDS is not available in your instance, or the size of the GDS projection is too large for your instance.
22+
* GDS is not available in your instance, or the size of the GDS projection is too large for your instance.
2323

2424
Use GDS if:
2525

@@ -64,7 +64,7 @@ CREATE (asc)-[:LINK {distance: 7.25}]->(cnm),
6464
(wof)-[:LINK {distance: 0.65}]->(wos)
6565
----
6666

67-
The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match.
67+
The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match, and can be either an `INTEGER` literal or a parameter which resolves to an `INTEGER`.
6868
For example, the following example uses `SHORTEST 1` to return the length of the shortest path between `Worcester Shrub Hill` and `Bromsgrove`:
6969

7070
.Query

0 commit comments

Comments
 (0)