Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix syntax problem for values #974

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
```ngql
INSERT VERTEX [IF NOT EXISTS] <tag_name> (<property_name>[, <property_name>...])
[, <tag_name> (<property_name>[, <property_name>...]), ...]
{VALUES | VALUE} <vid>: (<property_value>[, <property_value>...])
VALUES <vid>: (<property_value>[, <property_value>...])
[, <vid>: (<property_value>[, <property_value>...];
```

Expand All @@ -198,7 +198,7 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi

```ngql
INSERT EDGE [IF NOT EXISTS] <edge_type> (<property_name>[, <property_name>...])
{VALUES | VALUE} <src_vid> -> <dst_vid>[@<rank>] : (<property_value>[, <property_value>...])
VALUES <src_vid> -> <dst_vid>[@<rank>] : (<property_value>[, <property_value>...])
[, <src_vid> -> <dst_vid>[@<rank>] : (<property_name>[, <property_name>...]), ...];
```

Expand Down Expand Up @@ -445,7 +445,7 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
* Insert a vertex with VID `player111` and `UPSERT` it.

```ngql
nebula> INSERT VERTEX player(name,age) values "player111":("David West", 38);
nebula> INSERT VERTEX player(name,age) VALUES "player111":("David West", 38);

nebula> UPSERT VERTEX "player111" SET player.name = "David", player.age = $^.player.age + 11 \
WHEN $^.player.name == "David West" AND $^.player.age > 20 \
Expand Down
10 changes: 5 additions & 5 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
```
LOOKUP ON {<vertex_tag> | <edge_type>}
[WHERE <expression> [AND <expression> ...]]
[YIELD <return_list> [AS <alias>]]
YIELD <return_list> [AS <alias>]
```

| Pattern | Example | Description |
Expand All @@ -270,7 +270,7 @@
GO [[<M> TO] <N> STEPS ] FROM <vertex_list>
OVER <edge_type_list> [{REVERSELY | BIDIRECT}]
[ WHERE <conditions> ]
[YIELD [DISTINCT] <return_list>]
YIELD [DISTINCT] <return_list>
[| GROUP BY {col_name | expr | position} YIELD <col_name>]
[| ORDER BY <expression> [{ASC | DESC}]]
[| LIMIT [<offset_value>,] <number_rows>]
Expand All @@ -294,7 +294,7 @@
```
FETCH PROP ON {<tag_name>[, tag_name ...] | *}
<vid> [, vid ...]
[YIELD <return_list> [AS <alias>]]
YIELD <return_list> [AS <alias>]
```

| Example | Description |
Expand Down Expand Up @@ -411,7 +411,7 @@

| Statement | Syntax | Example | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md) | `INSERT VERTEX [IF NOT EXISTS] <tag_name> (<prop_name_list>) [, <tag_name> (<prop_name_list>), ...] {VALUES | VALUE} VID: (<prop_value_list>[, <prop_value_list>])` | `INSERT VERTEX t2 (name, age) VALUES "13":("n3", 12), "14":("n4", 8)` | Inserts one or more vertices into a graph space in Nebula Graph. |
| [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md) | `INSERT VERTEX [IF NOT EXISTS] <tag_name> (<prop_name_list>) [, <tag_name> (<prop_name_list>), ...] VALUES VID: (<prop_value_list>[, <prop_value_list>])` | `INSERT VERTEX t2 (name, age) VALUES "13":("n3", 12), "14":("n4", 8)` | Inserts one or more vertices into a graph space in Nebula Graph. |
| [DELETE VERTEX](../3.ngql-guide/12.vertex-statements/4.delete-vertex.md) | `DELETE VERTEX <vid> [, <vid> ...]` | `DELETE VERTEX "team1"` | Deletes vertices and the related incoming and outgoing edges of the vertices. |
| [UPDATE VERTEX](../3.ngql-guide/12.vertex-statements/2.update-vertex.md) | `UPDATE VERTEX ON <tag_name> <vid> SET <update_prop> [WHEN <condition>] [YIELD <output>]` | `UPDATE VERTEX ON player "player101" SET age = age + 2 ` | Updates properties on tags of a vertex. |
| [UPSERT VERTEX](../3.ngql-guide/12.vertex-statements/3.upsert-vertex.md) | `UPSERT VERTEX ON <tag> <vid> SET <update_prop> [WHEN <condition>] [YIELD <output>]` | `UPSERT VERTEX ON player "player667" SET age = 31` | The `UPSERT` statement is a combination of `UPDATE` and `INSERT`. You can use `UPSERT VERTEX` to update the properties of a vertex if it exists or insert a new vertex if it does not exist. |
Expand All @@ -422,7 +422,7 @@

| Statement | Syntax | Example | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md) | `INSERT EDGE [IF NOT EXISTS] <edge_type> ( <prop_name_list> ) {VALUES | VALUE} <src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> ) [, <src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> ), ...]` | `INSERT EDGE e2 (name, age) VALUES "11"->"13":("n1", 1)` | Inserts an edge or multiple edges into a graph space from a source vertex (given by src_vid) to a destination vertex (given by dst_vid) with a specific rank in Nebula Graph. |
| [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md) | `INSERT EDGE [IF NOT EXISTS] <edge_type> ( <prop_name_list> ) VALUES <src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> ) [, <src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> ), ...]` | `INSERT EDGE e2 (name, age) VALUES "11"->"13":("n1", 1)` | Inserts an edge or multiple edges into a graph space from a source vertex (given by src_vid) to a destination vertex (given by dst_vid) with a specific rank in Nebula Graph. |
| [DELETE EDGE](../3.ngql-guide/12.vertex-statements/3.upsert-vertex.md) | `DELETE EDGE <edge_type> <src_vid> -> <dst_vid>[@<rank>] [, <src_vid> -> <dst_vid>[@<rank>] ...]` | `DELETE EDGE serve "player100" -> "team204"@0` | Deletes one edge or multiple edges at a time. |
| [UPDATE EDGE](../3.ngql-guide/13.edge-statements/2.update-edge.md) | `UPDATE EDGE ON <edge_type> <src_vid> -> <dst_vid> [@<rank>] SET <update_prop> [WHEN <condition>] [YIELD <output>]` | `UPDATE EDGE ON serve "player100" -> "team204"@0 SET start_year = start_year + 1` | Updates properties on an edge. |
| [UPSERT EDGE](../3.ngql-guide/12.vertex-statements/3.upsert-vertex.md) | `UPSERT EDGE ON <edge_type> <src_vid> -> <dst_vid> [@rank] SET <update_prop> [WHEN <condition>] [YIELD <properties>]` | `UPSERT EDGE on serve "player666" -> "team200"@0 SET end_year = 2021` | The `UPSERT` statement is a combination of `UPDATE` and `INSERT`. You can use `UPSERT EDGE` to update the properties of an edge if it exists or insert a new edge if it does not exist. |
Expand Down
4 changes: 2 additions & 2 deletions docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Running the `INSERT VERTEX` statement requires some [privileges](../../7.data-se

```ngql
INSERT VERTEX [IF NOT EXISTS] <tag_name> (<prop_name_list>) [, <tag_name> (<prop_name_list>), ...]
{VALUES | VALUE} VID: (<prop_value_list>[, <prop_value_list>])
VALUES VID: (<prop_value_list>[, <prop_value_list>])

prop_name_list:
[prop_name [, prop_name] ...]
Expand Down Expand Up @@ -49,7 +49,7 @@ Examples are as follows.
```ngql
# The following examples create tag t1 with no property and inserts vertex "10" with no property.
nebula> CREATE TAG IF NOT EXISTS t1();
nebula> INSERT VERTEX t1() VALUE "10":();
nebula> INSERT VERTEX t1() VALUES "10":();
```

```ngql
Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/3.ngql-guide/13.edge-statements/1.insert-edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ When inserting an edge that already exists, `INSERT VERTEX` **overrides** the ed
## Syntax

```ngql
INSERT EDGE [IF NOT EXISTS] <edge_type> ( <prop_name_list> ) {VALUES | VALUE}
INSERT EDGE [IF NOT EXISTS] <edge_type> ( <prop_name_list> ) VALUES
<src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> )
[, <src_vid> -> <dst_vid>[@<rank>] : ( <prop_value_list> ), ...];

Expand Down