Skip to content

Commit

Permalink
Update 2.match.md (#2034)
Browse files Browse the repository at this point in the history
* Update 2.match.md

* Update docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md

Co-authored-by: randomJoe211 <[email protected]>
  • Loading branch information
foesa-yang and randomJoe211 authored Jul 29, 2022
1 parent f3c99bb commit ea00f30
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 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,20 @@ 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"})> |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
## 多MATCH检索

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

0 comments on commit ea00f30

Please sign in to comment.