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.set.md #1114

Merged
merged 1 commit into from
Oct 29, 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
19 changes: 14 additions & 5 deletions docs-2.0/3.ngql-guide/5.operators/6.set.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ nebula> GO FROM "player102" OVER follow \
+-------------+
| follow._dst |
+-------------+
| "player100" |
| "player101" |
| "player102" |
| "player125" |
+-------------+

# 返回两个查询结果的并集,包含重复的元素。
Expand All @@ -41,9 +42,10 @@ nebula> GO FROM "player102" OVER follow \
+-------------+
| follow._dst |
+-------------+
| "player100" |
| "player101" |
| "player101" |
| "player102" |
| "player125" |
+-------------+

# UNION也可以和YIELD语句一起使用,去重时会检查每一行的所有列,每列都相同时才会去重。
Expand Down Expand Up @@ -80,7 +82,10 @@ nebula> GO FROM "player102" OVER follow \
INTERSECT \
GO FROM "player100" OVER follow \
YIELD dst(edge) AS id, properties(edge).degree AS Degree, properties($$).age AS Age;
Empty set (time spent 2990/3511 us)
+----+--------+-----+
| id | Degree | Age |
+----+--------+-----+
+----+--------+-----+
```

## MINUS
Expand All @@ -100,13 +105,17 @@ nebula> GO FROM "player100" OVER follow \
+-------------+
| follow._dst |
+-------------+
| "player102" |
| "player125" |
+-------------+

nebula> GO FROM "player102" OVER follow \
MINUS \
GO FROM "player100" OVER follow;
Empty set (time spent 2243/3259 us)
+-------------+
| follow._dst |
+-------------+
| "player100" |
+-------------+
```

## 集合运算符和管道符的优先级
Expand Down