Skip to content

Commit

Permalink
Update 3.property-reference.md
Browse files Browse the repository at this point in the history
  • Loading branch information
izhuxiaoqing authored Nov 1, 2021
1 parent e996f22 commit 3f82437
Showing 1 changed file with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,47 @@ Apart from the user-defined edge property, there are four built-in properties in
The following query returns the `name` property of the `player` tag on the source vertex and the `age` property of the `player` tag on the destination vertex.

```ngql
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 |
+--------------+--------+
```

The following query returns the `degree` property of the edge type `follow`.

```ngql
nebula> GO FROM "player100" OVER follow YIELD properties(edge).degree;
nebula> GO FROM "player100" OVER follow YIELD follow.degree;
+---------------+
| follow.degree |
+---------------+
| 95 |
| 90 |
| 95 |
+---------------+
```

The following query returns the source vertex, the destination vertex, the edge type, and the edge rank value of the edge type `follow`.

```ngql
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 "Legacy version compatibility"

Nebula Graph 2.6.0 and later versions support the new [Schema function](../6.functions-and-expressions/4.schema.md). The statements in the above examples are written as follows in 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);
```

In 2.6.0, Nebula Graph is still compatible with the old syntax.

0 comments on commit 3f82437

Please sign in to comment.