Skip to content

Commit

Permalink
Merge branch 'master' into cooper-lzy-patch-9
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-lzy authored Sep 22, 2022
2 parents 8852b40 + 5251022 commit d177e2d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 38 deletions.
4 changes: 2 additions & 2 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
* `UPDATE` edges:
```ngql
UPDATE EDGE <source vid> -> <destination vid> [@rank] OF <edge_type>
UPDATE EDGE ON <edge_type> <source vid> -> <destination vid> [@rank]
SET <properties to be updated> [WHEN <condition>] [YIELD <columns to be output>];
```
Expand Down Expand Up @@ -423,7 +423,7 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
* `UPDATE` the `degree` property of an edge and check the result with the `FETCH` statement.
```ngql
nebula> UPDATE EDGE "player101" -> "player100" OF follow SET degree = 96;
nebula> UPDATE EDGE ON follow "player101" -> "player100" SET degree = 96;
nebula> FETCH PROP ON follow "player101" -> "player100" YIELD properties(edge);
+------------------+
Expand Down
10 changes: 5 additions & 5 deletions docs-2.0/3.ngql-guide/13.edge-statements/2.update-edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ The following example checks the properties of the edge with the GO statement.
nebula> GO FROM "player100" \
OVER serve \
YIELD properties(edge).start_year, properties(edge).end_year;
+------------------+----------------+
| serve.start_year | serve.end_year |
+------------------+----------------+
| 1997 | 2016 |
+------------------+----------------+
+-----------------------------+---------------------------+
| properties(EDGE).start_year | properties(EDGE).end_year |
+-----------------------------+---------------------------+
| 1997 | 2016 |
+-----------------------------+---------------------------+
```

The following example updates the `start_year` property and returns the `end_year` and the new `start_year`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204":
| nodes | relationships |
+---------------------------+---------------+
| [("player101" :player{})] | [] |
| [] | [] |
+---------------------------+---------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ nebula> RETURN coalesce(null,[1,2,3]) as result;
| [1, 2, 3] |
+-----------+
nebula> RETURN coalesce(null) as result;
+-----------+
| result |
+-----------+
| NULL |
+-----------+
+----------+
| result |
+----------+
| __NULL__ |
+----------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ nebula> MATCH p = (n:player{name:"LeBron James"})-[:follow]->(m) \
nebula> MATCH (n:player) \
RETURN exists(n.player.id), n IS NOT NULL;
+--------------+---------------+
| exists(n.id) | n IS NOT NULL |
+--------------+---------------+
| false | true |
+---------------------+---------------+
| exists(n.player.id) | n IS NOT NULL |
+---------------------+---------------+
| false | true |
...
nebula> MATCH (n:player) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ nebula> FETCH PROP ON player "player101", "player102", "player103" YIELD propert
| properties(VERTEX) |
+--------------------------------------+
| {age: 33, name: "LaMarcus Aldridge"} |
| {age: 40, name: "Tony Parker"} |
| {age: 36, name: "Tony Parker"} |
| {age: 32, name: "Rudy Gay"} |
+--------------------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ SHOW CREATE SPACE <space_name>;

```ngql
nebula> SHOW CREATE SPACE basketballplayer;
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Space | Create Space |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "basketballplayer" | "CREATE SPACE `basketballplayer` (partition_num = 10, replica_factor = 1, charset = utf8, collate = utf8_bin, vid_type = FIXED_STRING(32), atomic_edge = false) ON default_zone_192.168.8.132_9779" |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+--------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Space | Create Space |
+--------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "basketballplayer" | "CREATE SPACE `basketballplayer` (partition_num = 10, replica_factor = 1, charset = utf8, collate = utf8_bin, vid_type = FIXED_STRING(32), atomic_edge = false)" |
+--------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ SHOW {TAG | EDGE} INDEXES;

```ngql
nebula> SHOW TAG INDEXES;
+------------------+--------------+-----------------+
| Index Name | By Tag | Columns |
+------------------+--------------+-----------------+
| "fix" | "fix_string" | ["p1"] |
| "player_index_0" | "player" | ["name"] |
| "player_index_1" | "player" | ["name", "age"] |
| "var" | "var_string" | ["p1"] |
+------------------+--------------+-----------------+
+------------------+----------+----------+
| Index Name | By Tag | Columns |
+------------------+----------+----------+
| "player_index_0" | "player" | [] |
| "player_index_1" | "player" | ["name"] |
+------------------+----------+----------+
nebula> SHOW EDGE INDEXES;
+----------------+----------+---------+
Expand Down
14 changes: 7 additions & 7 deletions docs-2.0/3.ngql-guide/8.clauses-and-options/return.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ Use the `nodes()` function to return all vertices in a path.
```ngql
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \
RETURN nodes(p);
+---------------------------------------------------------------------------------------------------------------------+
| nodes(p) |
+---------------------------------------------------------------------------------------------------------------------+
| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player204" :team{name: "Spurs"})] |
| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player101" :player{name: "Tony Parker", age: 36})] |
| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player125" :player{name: "Manu Ginobili", age: 41})] |
+---------------------------------------------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------------------------------------+
| nodes(p) |
+-------------------------------------------------------------------------------------------------------------+
| [("player100" :player{age: 42, name: "Tim Duncan"}), ("team204" :team{name: "Spurs"})] |
| [("player100" :player{age: 42, name: "Tim Duncan"}), ("player101" :player{age: 36, name: "Tony Parker"})] |
| [("player100" :player{age: 42, name: "Tim Duncan"}), ("player125" :player{age: 41, name: "Manu Ginobili"})] |
+-------------------------------------------------------------------------------------------------------------+
```

### Return edges in a path
Expand Down

0 comments on commit d177e2d

Please sign in to comment.