Skip to content

Commit

Permalink
Update 6.find-path.md (#2397)
Browse files Browse the repository at this point in the history
* Update 6.find-path.md

Add annotation to example of find-path

* modify pr format

* Update 6.find-path.md

---------

Co-authored-by: Steam <[email protected]>
Co-authored-by: abby.huang <[email protected]>
  • Loading branch information
3 people authored Dec 26, 2023
1 parent 5579687 commit 4a655f3
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 4a655f3

Please sign in to comment.