Skip to content

Commit

Permalink
Update 9.type-conversion.md
Browse files Browse the repository at this point in the history
  • Loading branch information
izhuxiaoqing authored Nov 1, 2021
1 parent bb55a8d commit c0cdf22
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions docs-2.0/3.ngql-guide/3.data-types/9.type-conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Converting an expression of a given type to another type is known as type conver
## Examples

```ngql
nebula> UNWIND [true, false, 'true', 'false', NULL] AS b RETURN toBoolean(b) AS b;
nebula> UNWIND [true, false, 'true', 'false', NULL] AS b \
RETURN toBoolean(b) AS b;
+----------+
| b |
+----------+
Expand All @@ -45,22 +46,27 @@ nebula> RETURN toInteger(1), toInteger('1'), toInteger('1e3'), toInteger('not a
| 1 | 1 | 1000 | __NULL__ |
+--------------+----------------+------------------+---------------------------+
nebula> MATCH (a:player)-[e]-() RETURN type(e);
nebula> MATCH (a:player)-[e]-() \
RETURN type(e);
+----------+
| type(e) |
+----------+
| "follow" |
| "follow" |
+----------+
nebula> MATCH (a:player {name: "Tim Duncan"}) WHERE toInteger(id(a)) == 100 RETURN a;
+----------------------------------------------+
| a |
+----------------------------------------------+
| ("100" :player{age: 42, name: "Tim Duncan"}) |
+----------------------------------------------+
nebula> MATCH (a:player {name: "Tim Duncan"}) \
WHERE toInteger(right(id(a),3)) == 100 \
RETURN a;
+----------------------------------------------------+
| a |
+----------------------------------------------------+
| ("player100" :player{age: 42, name: "Tim Duncan"}) |
+----------------------------------------------------+
nebula> MATCH (n:player) WITH n LIMIT toInteger(ceil(1.8)) RETURN count(*) AS count;
nebula> MATCH (n:player) \
WITH n LIMIT toInteger(ceil(1.8)) \
RETURN count(*) AS count;
+-------+
| count |
+-------+
Expand Down

0 comments on commit c0cdf22

Please sign in to comment.