Skip to content

Commit

Permalink
add annotation to some examples of list clause (#2400)
Browse files Browse the repository at this point in the history
as titled
  • Loading branch information
knqiufan authored Dec 27, 2023
1 parent 0d18a49 commit 01f80f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs-2.0-zh/3.ngql-guide/5.operators/8.list.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,31 @@
## 示例

```ngql
# 返回连接后的列表。
nebula> YIELD [1,2,3,4,5]+[6,7] AS myList;
+-----------------------+
| myList |
+-----------------------+
| [1, 2, 3, 4, 5, 6, 7] |
+-----------------------+
# 返回列表中的元素数量。
nebula> RETURN size([NULL, 1, 2]);
+------------------+
| size([NULL,1,2]) |
+------------------+
| 3 |
+------------------+
# 返回 NULL 是否存在列表中。
nebula> RETURN NULL IN [NULL, 1];
+--------------------+
| (NULL IN [NULL,1]) |
+--------------------+
| __NULL__ |
+--------------------+
# 返回在列表[2, 3, 4, 5]中存在,且也在列表[2, 3, 8]中存在的元素,并拆分显示。
nebula> WITH [2, 3, 4, 5] AS numberlist \
UNWIND numberlist AS number \
WITH number \
Expand All @@ -44,6 +48,7 @@ nebula> WITH [2, 3, 4, 5] AS numberlist \
| 3 |
+--------+
# 返回列表中下标为 1 的元素。
nebula> WITH ['Anne', 'John', 'Bill', 'Diane', 'Eve'] AS names RETURN names[1] AS result;
+--------+
| result |
Expand Down

0 comments on commit 01f80f9

Please sign in to comment.