Skip to content

Commit

Permalink
fix coalesce() (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu authored Jun 9, 2022
1 parent c946e27 commit a107c73
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs-2.0/3.ngql-guide/6.functions-and-expressions/6.list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Nebula Graph 支持以下列表(List)函数。
| tail(list) | 返回不包含原列表第一个元素的新列表。|
| head(list) | 返回列表的第一个元素。 |
| last(list) | 返回列表的最后一个元素。 |
| coalesce(list) | 返回列表中第一个非空元素|
| coalesce(item0 [, item1, item2]) | 返回多个参数中第一个非空元素|
| reduce() | 请参见 [reduce 函数](./11.reduce.md)|

!!! Note
Expand All @@ -24,12 +24,12 @@ Nebula Graph 支持以下列表(List)函数。

```ngql
nebula> WITH [NULL, 4923, 'abc', 521, 487] AS ids \
RETURN reverse(ids), tail(ids), head(ids), last(ids), coalesce(ids);
+-----------------------------------+-------------------------+-----------+-----------+---------------+
| reverse(ids) | tail(ids) | head(ids) | last(ids) | coalesce(ids) |
+-----------------------------------+-------------------------+-----------+-----------+---------------+
| [487, 521, "abc", 4923, __NULL__] | [4923, "abc", 521, 487] | __NULL__ | 487 | 4923 |
+-----------------------------------+-------------------------+-----------+-----------+---------------+
RETURN reverse(ids), tail(ids), head(ids), last(ids), coalesce(ids[0], ids[1], ids[2]), head([x IN ids WHERE x IS NOT NULL | x]);
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+
| reverse(ids) | tail(ids) | head(ids) | last(ids) | coalesce(ids[0],ids[1],ids[2]) | head([__VAR_0 IN ids WHERE $__VAR_0 IS NOT NULL | $__VAR_0]) |
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+
| [487, 521, "abc", 4923, __NULL__] | [4923, "abc", 521, 487] | __NULL__ | 487 | 4923 | 4923 |
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+
nebula> MATCH (a:player)-[r]->() \
WHERE id(a) == "player100" \
Expand Down

0 comments on commit a107c73

Please sign in to comment.