Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document lower bound restriction for shortestPath() and allShortestPath() functions #1146

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/ROOT/pages/patterns/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,7 @@ They are similar to `SHORTEST 1` and `ALL SHORTEST`, but with several difference
* The path pattern is passed as an argument to the functions.
* The path pattern is limited to a single relationship pattern.
* To return results where the first and last node in the path are the same requires a change to the configuration setting link:{neo4j-docs-base-uri}/operations-manual/{page-version}/configuration/configuration-settings/#config_dbms.cypher.forbid_shortestpath_common_nodes[`dbms.cypher.forbid_shortestpath_common_nodes`].
* The minimum path length, also called the lower bound of the variable length relationship pattern, should be 0 or 1.

Both functions will continue to be available, but they are not xref:appendix/gql-conformance/index.adoc[GQL conformant].

Expand Down Expand Up @@ -1414,7 +1415,7 @@ shortestPath((:A)-->+(:B))
[[shortest-functions-rules-path-pattern-length]]
==== Path pattern length

There must be exactly one relationship pattern in the path pattern.
There must be exactly one relationship pattern in the path pattern, and the lower bound should be 0 or 1.

.Allowed
[source]
Expand All @@ -1427,6 +1428,8 @@ shortestPath((a)-[:R*1..5]-(b))
----
shortestPath((a)-[:R*1..5]-(b)-->(:X))

shortestPath((a)-[:R*2..5]-(b))

shortestPath((:A))

allShortestPaths((a:A)-[:S*]->(:B), (a)-[:R*1..3]->(:C))
Expand Down
Loading