Skip to content

Commit

Permalink
add annotation (#2411)
Browse files Browse the repository at this point in the history
* add annotation

as title

* modify format

* Update 2.match.md

---------

Co-authored-by: Steam <evaz1879@gmail.com>
Co-authored-by: abby.huang <78209557+abby-cyber@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 2, 2024
1 parent 66303fc commit 79fa4bf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ nebula> MATCH (v:player{name:"Tim Duncan"}) \
使用`WHERE`子句也可以实现相同的操作:

```ngql
# 查找类型为 player,名字为 Tim Duncan 的点。
nebula> MATCH (v:player) \
WHERE v.player.name == "Tim Duncan" \
RETURN v;
Expand Down Expand Up @@ -157,6 +158,7 @@ nebula> WITH ['Tim Duncan', 'Yao Ming'] AS names \
用户可以使用点 ID 去匹配点。`id()`函数可以检索点的 ID。

```ngql
# 查找 ID 为 “player101” 的点。(注:ID 全局唯一)。
nebula> MATCH (v) \
WHERE id(v) == 'player101' \
RETURN v;
Expand All @@ -170,6 +172,7 @@ nebula> MATCH (v) \
要匹配多个点的 ID,可以用`WHERE id(v) IN [vid_list]`或者`WHERE id(v) IN {vid_list}`

```ngql
# 查找与 `Tim Duncan` 直接相连的点,并且这些点的 ID 必须是 `player101` 或 `player102`。
nebula> MATCH (v:player { name: 'Tim Duncan' })--(v2) \
WHERE id(v2) IN ["player101", "player102"] \
RETURN v2;
Expand Down Expand Up @@ -215,7 +218,7 @@ nebula> MATCH (v:player{name:"Tim Duncan"})--(v2:player) \
用户可以在`--`符号上增加`<``>`符号指定边的方向。

```ngql
# -->表示边从 v 开始,指向 v2。对于点 v 来说是出边,对于点 v2 来说是入边。
# `-->` 表示边从 v 开始,指向 v2。对于点 v 来说是出边,对于点 v2 来说是入边。
nebula> MATCH (v:player{name:"Tim Duncan"})-->(v2:player) \
RETURN v2.player.name AS Name;
+-----------------+
Expand Down

0 comments on commit 79fa4bf

Please sign in to comment.