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

Update 6.find-path.md #2397

Merged
merged 3 commits into from
Dec 26, 2023
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ YIELD path as <alias>
返回的路径格式类似于`(<vertex_id>)-[:<edge_type_name>@<rank>]->(<vertex_id)`。

```ngql
# 查找并返回player102到team204的最短路径
nebula> FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path AS p;
+--------------------------------------------+
| p |
Expand All @@ -76,6 +77,7 @@ nebula> FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path AS p;
```

```ngql
# 查找并返回带属性值的team204到player100的最短反向路径
nebula> FIND SHORTEST PATH WITH PROP FROM "team204" TO "player100" OVER * REVERSELY YIELD path AS p;
+--------------------------------------------------------------------------------------------------------------------------------------+
| p |
Expand All @@ -85,6 +87,7 @@ nebula> FIND SHORTEST PATH WITH PROP FROM "team204" TO "player100" OVER * REVERS
```

```ngql
# 查找并返回起点为player100,player130而终点为player132,player133的18跳之内双向最短路径
nebula> FIND SHORTEST PATH FROM "player100", "player130" TO "player132", "player133" OVER * BIDIRECT UPTO 18 STEPS YIELD path as p;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| p |
Expand All @@ -104,6 +107,7 @@ nebula> FIND SHORTEST PATH FROM "player100", "player130" TO "player132", "player


```ngql
# 查找所有从player100到team204,并且degree为空或者大于等于0的路径
nebula> FIND ALL PATH FROM "player100" TO "team204" OVER * WHERE follow.degree is EMPTY or follow.degree >=0 YIELD path AS p;
+------------------------------------------------------------------------------+
| p |
Expand All @@ -116,6 +120,7 @@ nebula> FIND ALL PATH FROM "player100" TO "team204" OVER * WHERE follow.degree i
```

```ngql
# 查找所有从player100到team204无环路径
nebula> FIND NOLOOP PATH FROM "player100" TO "team204" OVER * YIELD path AS p;
+--------------------------------------------------------------------------------------------------------+
| p |
Expand Down