You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/patterns/match-modes.adoc
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,11 +181,10 @@ The next example matches paths starting and ending at the same `Location` (`Knei
181
181
----
182
182
MATCH REPEATABLE ELEMENTS p = (start:Location {name: 'Kneiphof'})-[:BRIDGE]-{,9}(start) // <1>
183
183
WHERE all(bridge IN range(1,7) WHERE bridge IN [r IN relationships(p) | r.id]) // <2>
184
-
WITH p
185
-
ORDER BY length(p)
186
-
LIMIT 1
187
184
RETURN [n IN nodes(p) | n.name] AS visitedLocations,
188
185
[r IN relationships(p) | r.id] AS crossedBridges
186
+
ORDER BY length(p), crossedBridges
187
+
LIMIT 1
189
188
----
190
189
191
190
<1> Paths with a length of less than 9 relationships return no results because they do not allow enough moves to traverse all seven bridges at least once while forming a cycle back to Kneiphof.
@@ -196,13 +195,13 @@ RETURN [n IN nodes(p) | n.name] AS visitedLocations,
0 commit comments