Skip to content

Commit d3adebd

Browse files
authored
Fix examples in Patterns / Syntax and semantics / shortestPaths (#1151)
The examples in Patterns / Syntax and semantics / shortestPaths / Examples mix legacy shortest path and QPPs, which is disallowed. This PR changes them to variable-length relationships. It also improves the header "Restricted to variable length". QPPs are disallowed but also variable length. What they are not are variable-length relationships.
1 parent 912325e commit d3adebd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/ROOT/pages/patterns/reference.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ Note that it is possible to pass a fixed length path pattern (with a single rela
13991399
=== Rules
14001400

14011401
[[shortest-functions-rules-var-length-restriction]]
1402-
==== Restricted to variable length
1402+
==== Restricted to variable-length relationships
14031403

14041404
The pattern in the path selector function must be a variable-length relationship and not a quantified path pattern.
14051405

@@ -1470,14 +1470,14 @@ Return a single shortest path for each distinct pair of nodes matching `(:A)` an
14701470

14711471
[source, role=noheader]
14721472
----
1473-
MATCH shortestPath((:A)-[:R]->{0,10}(:B))
1473+
MATCH shortestPath((:A)-[:R*0..10]->(:B))
14741474
----
14751475

14761476
Return all paths equal to the shortest path length for each distinct pair of nodes matching `(:A)` and `(:B)`:
14771477

14781478
[source, role=noheader]
14791479
----
1480-
MATCH allShortestPaths((:A)-[:R]->{0,10}(:B))
1480+
MATCH allShortestPaths((:A)-[:R*0..10]->(:B))
14811481
----
14821482

14831483
[[graph-patterns]]

0 commit comments

Comments
 (0)