Skip to content

Commit

Permalink
highlight on bulk edge where filtering expression (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
abby-cyber committed Nov 10, 2022
1 parent 6cb1251 commit b84fe01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 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 @@ -462,6 +462,28 @@ nebula> MATCH (v:player{name:"Tim Duncan"}) -[*0]-> (v2) \
+----------------------------------------------------+
```

!!! Note

如果想要通过描述多跳的边的过滤条件,比如`-[e:follow*2]->`,这时候 `e` 不再是单条边时候的数据类型了,而是一列边组成的列表,例如:
以下语句可以运行但是没有返回数据,因为`e`是一个列表,没有`.degree`的属性。
```ngql
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) \
WHERE e.degree > 1 \
RETURN DISTINCT v2 AS Friends;
```
这是正确的表达:
```ngql
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) \
WHERE ALL(e_ in e WHERE e_.degree > 0) \
RETURN DISTINCT v2 AS Friends;
```
进一步,这是表达对多跳边的第一跳的边属性过滤的表达:
```ngql
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) \
WHERE e[0].degree > 98 \
RETURN DISTINCT v2 AS Friends;
```

### 匹配变长路径

用户可以在模式中使用`:<edge_type>*[minHop..maxHop]`匹配变长路径。
Expand Down

0 comments on commit b84fe01

Please sign in to comment.