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 6.cheatsheet-for-ngql-command.md #1271

Merged
merged 1 commit into from
Nov 26, 2021
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
6 changes: 3 additions & 3 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@
| 匹配边的属性 | ` MATCH (v:player{name:"Tim Duncan"})-[e:follow{degree:95}]->(v2) RETURN e` | 用户可以用`{<prop_name>: <prop_value>}`表示模式中 Edge type 的属性,例如`[e:follow{likeness:95}]`。 |
| 匹配多个 Edge type | `MATCH (v:player{name:"Tim Duncan"})-[e:follow | :serve]->(v2) RETURN e` | 使用`|`可以匹配多个 Edge type,例如`[e:follow | :serve]`。第一个 Edge type 前的英文冒号(:)不可省略,后续 Edge type 前的英文冒号可以省略,例如`[e:follow | serve]`。 |
| 匹配多条边 | `MATCH (v:player{name:"Tim Duncan"})-[]->(v2)<-[e:serve]-(v3) RETURN v2, v3` | 用户可以扩展模式,匹配路径中的多条边。 |
| 匹配定长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) RETURN DISTINCT v2 AS Friends` | 用户可以在模式中使用`:<edge_type>*<hop>`匹配定长路径。`hop`必须是一个非负整数。 |
| 匹配变长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2) RETURN v2 AS Friends` | `minHop`:可选项。表示路径的最小长度。`minHop`必须是一个非负整数,默认值为 1。<br>`maxHop`:必选项。表示路径的最大长度。`maxHop`必须是一个非负整数,没有默认值。 |
| 匹配多个 Edge type 的变长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow | serve*2]->(v2) RETURN DISTINCT v2` | 用户可以在变长或定长模式中指定多个 Edge type。`hop`、`minHop`和`maxHop`对所有 Edge type 都生效。 |
| 匹配定长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) RETURN DISTINCT v2 AS Friends` | 用户可以在模式中使用`:<edge_type>*<hop>`匹配定长路径。`hop`必须是一个非负整数。`e`的数据类型是列表。 |
| 匹配变长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2) RETURN v2 AS Friends` | `minHop`:可选项。表示路径的最小长度。`minHop`必须是一个非负整数,默认值为 1。<br>`maxHop`:必选项。表示路径的最大长度。`maxHop`必须是一个非负整数,没有默认值。`e`的数据类型是列表。 |
| 匹配多个 Edge type 的变长路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[e:follow | serve*2]->(v2) RETURN DISTINCT v2` | 用户可以在变长或定长模式中指定多个 Edge type。`hop`、`minHop`和`maxHop`对所有 Edge type 都生效。`e`的数据类型是列表。|
| 检索点或边的信息 | `MATCH (v:player{name:"Tim Duncan"}) RETURN v`<br>`MATCH (v:player{name:"Tim Duncan"})-[e]->(v2) RETURN e` | 使用`RETURN {<vertex_name> | <edge_name>}`检索点或边的所有信息。 |
| 检索点 ID | `MATCH (v:player{name:"Tim Duncan"}) RETURN id(v)` | 使用`id()`函数检索点 ID。 |
| 检索 Tag | `MATCH (v:player{name:"Tim Duncan"}) RETURN labels(v)` | 使用`labels()`函数检索点上的 Tag 列表。<br>检索列表`labels(v)`中的第 N 个元素,可以使用`labels(v)[n-1]`。 |
Expand Down