Skip to content

Commit

Permalink
Update 3.property-reference.md (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomJoe211 authored Oct 27, 2021
1 parent 12c676f commit 57d1f05
Showing 1 changed file with 24 additions and 11 deletions.
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依然兼容旧语法。

0 comments on commit 57d1f05

Please sign in to comment.