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 #2667

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Changes from all commits
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
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 @@ -478,9 +478,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 @@ -577,6 +578,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