diff --git a/docs-2.0/3.ngql-guide/4.variable-and-composite-queries/3.property-reference.md b/docs-2.0/3.ngql-guide/4.variable-and-composite-queries/3.property-reference.md index 38fc8257b54..61b86a20149 100644 --- a/docs-2.0/3.ngql-guide/4.variable-and-composite-queries/3.property-reference.md +++ b/docs-2.0/3.ngql-guide/4.variable-and-composite-queries/3.property-reference.md @@ -60,29 +60,42 @@ $$.. ```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依然兼容旧语法。