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 set clause #2433

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
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
Next Next commit
add annotation to some examples of set clause
as titled
knqiufan authored Jan 17, 2024
commit 6f2574f8b979c7cc47abe4d9a5c1d2e1031a7ce6
7 changes: 7 additions & 0 deletions docs-2.0-zh/3.ngql-guide/5.operators/6.set.md
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) \
| "player125" |
+-------------+

# 查询 Tag 为 player 的点,根据名称排序后获取前 3 条数据,并与数组合并返回,不包含重复的元素。
nebula> MATCH (v:player) \
WITH v.player.name AS n \
RETURN n ORDER BY n LIMIT 3 \
@@ -63,6 +64,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) \
| "player125" |
+-------------+

# 查询 Tag 为 player 的点,根据名称排序后获取前 3 条数据,并与数组合并返回,包含重复的元素。
nebula> MATCH (v:player) \
WITH v.player.name AS n \
RETURN n ORDER BY n LIMIT 3 \
@@ -120,6 +122,7 @@ nebula> GO FROM "player102" OVER follow \
+----+--------+-----+
+----+--------+-----+

# 返回 player102 的目标点和边数据与 player100 的目标点和边数据之间的交集。
nebula> MATCH (v:player)-[e:follow]->(v2) \
WHERE id(v) == "player102" \
RETURN id(v2) As id, e.degree As Degree, v2.player.age AS Age \
@@ -132,6 +135,7 @@ nebula> MATCH (v:player)-[e:follow]->(v2) \
+----+--------+-----+
+----+--------+-----+

# 返回 [1,2] 与 [1,2,3,4] 的交集。
nebula> UNWIND [1,2] AS a RETURN a \
INTERSECT \
UNWIND [1,2,3,4] AS a \
@@ -165,6 +169,7 @@ nebula> GO FROM "player100" OVER follow YIELD dst(edge) \
| "player125" |
+-------------+

# 返回在 player102 的目的点中,但不在 player100 的目的点中的元素。
nebula> GO FROM "player102" OVER follow YIELD dst(edge) AS id \
MINUS \
GO FROM "player100" OVER follow YIELD dst(edge) AS id;
@@ -174,6 +179,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) AS id \
| "player100" |
+-------------+

# 返回在 player102 的目的点中,但不在 player100 的目的点中的元素。
nebula> MATCH (v:player)-[e:follow]->(v2) \
WHERE id(v) =="player102" \
RETURN id(v2) AS id\
@@ -187,6 +193,7 @@ nebula> MATCH (v:player)-[e:follow]->(v2) \
| "player100" |
+-------------+

# 返回 [1,2,3] 中不与 4 相同的元素。
nebula> UNWIND [1,2,3] AS a RETURN a \
MINUS \
WITH 4 AS a \