Skip to content

Commit

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

* expression reorganized
  • Loading branch information
abby-cyber authored Apr 12, 2023
1 parent b212539 commit 7263ed3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 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 @@ -488,9 +488,10 @@ nebula> MATCH (v:player{name:"Tim Duncan"}) -[*0]-> (v2) \
+----------------------------------------------------+
```

!!! Note
!!! note

在对匹配的多跳边进行过滤时,如对`-[e:follow*2]->`中的`e`进行过滤,此时的`e`不再是单条边的数据类型,而是一个包含多条边的列表,例如:

如果想要通过描述多跳的边的过滤条件,比如`-[e:follow*2]->`,这时候 `e` 不再是单条边时候的数据类型了,而是一列边组成的列表,例如:
以下语句可以运行但是没有返回数据,因为`e`是一个列表,没有`.degree`的属性。
```ngql
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) \
Expand Down Expand Up @@ -587,6 +588,16 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*0..3]->(v2:player) \
+-----------------------------------------------------------+-----------+
```

!!! note

当在模式中使用变量`e`匹配定长或者变长路径时,例如`-[e:follow*0..3]->`,不支持在其他模式中引用`e`。例如,不支持以下语句:

```ngql
nebula> MATCH (v:player)-[e:like*1..3]->(n) \
WHERE (n)-[e*1..4]->(:player) \
RETURN v;
```

### 匹配多个 Edge type 的变长路径

用户可以在变长或定长模式中指定多个 Edge type。`hop``minHop``maxHop`对所有 Edge type 都生效。
Expand Down

0 comments on commit 7263ed3

Please sign in to comment.