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 2.match.md #2034

Merged
merged 2 commits into from
Jul 29, 2022
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
16 changes: 16 additions & 0 deletions docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,22 @@ nebula> MATCH (v1:player{name:"Tim Duncan"}), (v2:team{name:"Spurs"}) \
+----------------------------------------------------+----------------------------------+
```

### 匹配最短路径

用户可以用 `shortestPath` 表示模式中的路径。

```
nebula> MATCH p = shortestPath((a:player)-[e:follow*..2]-(b:player))\
WHERE a.player.age > 45 AND b.player.age < 30 \
RETURN p;
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| p |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| <("player144" :player{age: 47, name: "Shaquille O'Neal"})-[:follow@0 {degree: 80}]->("player100" :player{age: 42, name: "Tim Duncan"})<-[:follow@0 {degree: 99}]-("player113" :player{age: 29, name: "Dejounte Murray"})> |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```


randomJoe211 marked this conversation as resolved.
Show resolved Hide resolved
## 多MATCH检索

不同的模式有不同的筛选条件时,可以使用多`MATCH`,会返回模式完全匹配的行。
Expand Down