Skip to content

Commit

Permalink
highlight on bulk edge where filtering expression
Browse files Browse the repository at this point in the history
close #824
  • Loading branch information
wey-gu committed Nov 25, 2021
1 parent 1aca44c commit 9cff658
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 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 @@ -368,6 +368,30 @@ 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 9cff658

Please sign in to comment.