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

add annotation to some examples of OPTIONAL MATCH clause #2396

Merged
merged 1 commit into from
Dec 21, 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
`MATCH`语句中使用`OPTIONAL MATCH`的示例如下:

```ngql
# 找出特定节点 m(ID为 "player100" 的节点)直接连接的节点,以及这些节点 n 直连的下一层节点 l (OPTIONAL MATCH (n)-[]->(l)), 如果没有找到这样的节点 l,查询也会继续, l 的返回值是 null。
nebula> MATCH (m)-[]->(n) WHERE id(m)=="player100" \
OPTIONAL MATCH (n)-[]->(l) \
RETURN id(m),id(n),id(l);
Expand All @@ -39,6 +40,7 @@ nebula> MATCH (m)-[]->(n) WHERE id(m)=="player100" \
而使用多`MATCH`,不使用`OPTIONAL MATCH`时,会返回模式完全匹配的行。示例如下:

```ngql
# 找出特定节点 m(ID为 "player100" 的节点)直接连接的节点,以及这些节点 n 直连的下一层节点 l, 节点 l 必须存在。
nebula> MATCH (m)-[]->(n) WHERE id(m)=="player100" \
MATCH (n)-[]->(l) \
RETURN id(m),id(n),id(l);
Expand Down