From aac5c8126dddbd25ddc9f675d47dcfd0361c93d5 Mon Sep 17 00:00:00 2001 From: knqiufan <34114995+knqiufan@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:28:42 +0800 Subject: [PATCH] add annotation to some examples of `set` clause (#2433) * add annotation to some examples of `set` clause as titled * Update 6.set.md --------- Co-authored-by: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> --- docs-2.0-zh/3.ngql-guide/5.operators/6.set.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs-2.0-zh/3.ngql-guide/5.operators/6.set.md b/docs-2.0-zh/3.ngql-guide/5.operators/6.set.md index 57f5b6299f5..3308b64bb43 100644 --- a/docs-2.0-zh/3.ngql-guide/5.operators/6.set.md +++ b/docs-2.0-zh/3.ngql-guide/5.operators/6.set.md @@ -35,6 +35,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) \ | "player125" | +-------------+ +# 查询 Tag 为 player 的点,根据名称排序后获取前 3 条数据,并与数组合并返回,不包含重复的元素。 nebula> MATCH (v:player) \ WITH v.player.name AS n \ RETURN n ORDER BY n LIMIT 3 \ @@ -63,6 +64,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) \ | "player125" | +-------------+ +# 查询 Tag 为 player 的点,根据名称排序后获取前 3 条数据,并与数组合并返回,包含重复的元素。 nebula> MATCH (v:player) \ WITH v.player.name AS n \ RETURN n ORDER BY n LIMIT 3 \ @@ -120,6 +122,7 @@ nebula> GO FROM "player102" OVER follow \ +----+--------+-----+ +----+--------+-----+ +# 返回 player102 的邻居和边数据与 player100 的邻居和边数据之间的交集。 nebula> MATCH (v:player)-[e:follow]->(v2) \ WHERE id(v) == "player102" \ RETURN id(v2) As id, e.degree As Degree, v2.player.age AS Age \ @@ -132,6 +135,7 @@ nebula> MATCH (v:player)-[e:follow]->(v2) \ +----+--------+-----+ +----+--------+-----+ +# 返回 [1,2] 与 [1,2,3,4] 的交集。 nebula> UNWIND [1,2] AS a RETURN a \ INTERSECT \ UNWIND [1,2,3,4] AS a \ @@ -165,6 +169,7 @@ nebula> GO FROM "player100" OVER follow YIELD dst(edge) \ | "player125" | +-------------+ +# 返回在 player102 的邻居中,但不在 player100 的邻居中的元素。 nebula> GO FROM "player102" OVER follow YIELD dst(edge) AS id \ MINUS \ GO FROM "player100" OVER follow YIELD dst(edge) AS id; @@ -174,6 +179,7 @@ nebula> GO FROM "player102" OVER follow YIELD dst(edge) AS id \ | "player100" | +-------------+ +# 返回在 player102 的邻居中,但不在 player100 的邻居中的元素。 nebula> MATCH (v:player)-[e:follow]->(v2) \ WHERE id(v) =="player102" \ RETURN id(v2) AS id\ @@ -187,6 +193,7 @@ nebula> MATCH (v:player)-[e:follow]->(v2) \ | "player100" | +-------------+ +# 返回 [1,2,3] 中不与 4 相同的元素。 nebula> UNWIND [1,2,3] AS a RETURN a \ MINUS \ WITH 4 AS a \