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 3.property-reference.md #1109

Merged
merged 1 commit into from
Oct 27, 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
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,42 @@ $$.<tag_name>.<prop_name>

```ngql
# 返回起始点的Tag player的name属性值和目的点的Tag player的age属性值。
nebula> GO FROM "player100" OVER follow YIELD properties($^).name AS startName, properties($$).age AS endAge;
nebula> GO FROM "player100" OVER follow YIELD $^.player.name AS startName, $$.player.age AS endAge;
+--------------+--------+
| startName | endAge |
+--------------+--------+
| "Tim Duncan" | 36 |
| "Tim Duncan" | 33 |
| "Tim Duncan" | 41 |
+--------------+--------+


# 返回Edge type follow的degree属性值。
nebula> GO FROM "player100" OVER follow YIELD properties(edge).degree;
nebula> GO FROM "player100" OVER follow YIELD follow.degree;
+---------------+
| follow.degree |
+---------------+
| 95 |
| 90 |
| 95 |
+---------------+

# 返回EdgeType 是 follow 的起始点 VID、目的点 VID、EdgeType 编码(正数为正向边,负数为逆向边),和边的 rank 值。
nebula> GO FROM "player100" OVER follow YIELD src(edge), dst(edge), type(edge), rank(edge);
+-------------+-------------+------------+------------+
| src(EDGE) | dst(EDGE) | type(EDGE) | rank(EDGE) |
+-------------+-------------+------------+------------+
| "player100" | "player101" | "follow" | 0 |
| "player100" | "player125" | "follow" | 0 |
+-------------+-------------+------------+------------+
nebula> GO FROM "player100" OVER follow YIELD follow._src, follow._dst, follow._type, follow._rank;
+-------------+-------------+--------------+--------------+
| follow._src | follow._dst | follow._type | follow._rank |
+-------------+-------------+--------------+--------------+
| "player100" | "player101" | 17 | 0 |
| "player100" | "player125" | 17 | 0 |
+-------------+-------------+--------------+--------------+
```

!!! compatibility "历史版本兼容性"

Nebula Graph 2.6.0起支持了新的[Schema函数](../6.functions-and-expressions/4.schema.md),以上示例中的语句在2.6.0版本中的写法如下。

```ngql
GO FROM "player100" OVER follow YIELD properties($^).name AS startName, properties($$).age AS endAge;
GO FROM "player100" OVER follow YIELD properties(edge).degree;
GO FROM "player100" OVER follow YIELD src(edge), dst(edge), type(edge), rank(edge);
```

在2.6.0版本中Nebula Graph依然兼容旧语法。