Skip to content

Commit

Permalink
Merge 2.6.1 (#955)
Browse files Browse the repository at this point in the history
* Move to 2.6.0 (#838)

* Update deploy.yml

* Update mkdocs.yml

* Update mkdocs.yml

* Update 6.eco-tool-version.md

* Eco tools (#840)

* Move to 2.6.0 (#836)

* Revert "Move to 2.6.0 (#836)" (#837)

This reverts commit e4508b7.

* Update deploy.yml

* Update deploy.yml

* change eco-tools

console, importer, Docker Compose, Go, Python, Java

Co-authored-by: randomJoe211 <[email protected]>
Co-authored-by: min.wu <[email protected]>

* Update faq (#841)

* Move to 2.6.0 (#836)

* Revert "Move to 2.6.0 (#836)" (#837)

This reverts commit e4508b7.

* Update deploy.yml

* Update deploy.yml

* Update 0.FAQ.md

Co-authored-by: randomJoe211 <[email protected]>
Co-authored-by: min.wu <[email protected]>

* Update 8.map.md

* Update 4.schema.md

* Update 4.schema.md

* update connect to nebula (#842)

* update connect to nebula

* Update source_connect-to-nebula-graph.md

* Update source_connect-to-nebula-graph.md

* Update source_manage-service.md (#843)

* Update 4.nebula-graph-crud.md (#844)

* Update 2.deploy-es.md

* Update README.md

* Update 1.resource-preparations.md (#845)

* Update 1.resource-preparations.md (#846)

* Update mkdocs.yml

* group&zone (#847)

* group&zone

* Update 5.zone.md

* Update 5.zone.md (#849)

* Update 1.create-native-index.md

* Update ex-ug-limitations.md

* Update 7.count.md (#848)

count(expr) return -->count(expr) returns

* update exchange 2.6.0 (#852)

* Update 3.deploy-nebula-graph-with-docker-compose.md (#854)

* nGQL cheatsheet (#851)

* Update 1.install-nebula-graph-by-compiling-the-source-code.md (#850)

* Verify n gql (#855)

* verify nGQL

* merge new console table format

Co-authored-by: Yee <[email protected]>

* Update 5.lookup.md

* Update 4.date-and-time.md

* Update mkdocs.yml

* Update 5.null.md

* Update 9.type-conversion.md

* Upgrading nebula with docker compose updates (#857)

* Update 3.deploy-nebula-graph-with-docker-compose.md

* Update 3.deploy-nebula-graph-with-docker-compose.md

* Update 3.deploy-nebula-graph-with-docker-compose.md (#858)

* Update 3.property-reference.md

* deploy clusters on multiple servers (#856)

* updates

* Update deploy-nebula-graph-cluster.md

* Update 1.comparison.md

* Update 4.pipe.md

* Update 6.set.md

* Update source_install-nebula-graph-by-rpm-or-deb.md (#859)

* grammar error (#860)

* Update 4.nebula-graph-crud.md

* Update 1.get-subgraph.md

* Update 1.create-native-index.md

* Update 6.eco-tool-version.md

* Update mkdocs.yml

* Update upgrade-nebula-graph-to-260.md (#863)

* Update 7.string.md (#862)

* Update 5.case-expressions.md (#865)

* update nav (#866)

* update geo (#867)

* Update 3.date-and-time.md

* Update 3.date-and-time.md

* Create 4.install-nebula-graph-from-tar.md (#869)

* Create 4.install-nebula-graph-from-tar.md

* Update mkdocs.yml

* Update 6.eco-tool-version.md

* Update 6.eco-tool-version.md

* Update ex-ug-import-from-sst.md

* Update 3.date-and-time.md

* Update 3.date-and-time.md

* Update 3.date-and-time.md

* Update 6.eco-tool-version.md

* merge update studio (#871)

Co-authored-by: foesa <[email protected]>

* update go and lookup (#872)

* update studio (#874)

* update show (#876)

* Update limit.md (#877)

* release 2.6.1 (#878)

* Update ex-ug-limitations.md

* Update st-ug-limitations.md

* Update releasenote.md

* Update releasenote.md

* Update releasenote.md

* Update releasenote.md

* Update 0.FAQ.md

* Update 1.what-is-nebula-graph.md

* Update 3.manage-snapshot.md (#880)

checkpoints directory changed

* Update 3.deploy-nebula-graph-with-docker-compose.md

* Checkpoints directory changed (#881)

* Update 3.manage-snapshot.md

checkpoints directory changed

* Update 3.manage-snapshot.md

* Update source_manage-service.md (#882)

* Checkpoints directory changed (#883)

* Update 3.manage-snapshot.md

checkpoints directory changed

* Update 3.manage-snapshot.md

* Update 3.manage-snapshot.md

* Update ex-ug-import-from-sst.md

* Update 6.cheatsheet-for-ngql.md (#886)

change \| to |

* Update mkdocs.yml

* Update 6.eco-tool-version.md

* Update 6.show-hosts.md (#888)

* Update 6.show-hosts.md

* Update 6.show-hosts.md

* change upgrade (#889)

* Update mkdocs.yml

* Update 1.what-is-dashboard.md (#892) (#896)

* Update 1.what-is-dashboard.md

* Update 1.what-is-dashboard.md

* Update 1.what-is-dashboard.md (#897)

* settings and parameters (#894) (#899)

* settings and parameters

* add pics

* fix title

* Update 6.system-settings.md

* Update 7.monitor-parameter.md

* add operation and settings (#905)

* add operation and settings

* Update docs-2.0/nebula-dashboard-ent/4.cluster-operator/5.operation-record.md

Co-authored-by: abby.huang <[email protected]>

* Update docs-2.0/nebula-dashboard-ent/4.cluster-operator/6.settings.md

Co-authored-by: abby.huang <[email protected]>

* update

Co-authored-by: abby.huang <[email protected]>

* Update 6.settings.md

* add what is dashboard ent (#900)

* add what is dashboard ent

* update

* update

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update docs-2.0/nebula-dashboard-en/1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* Update 1.what-is-dashboard-en.md

Co-authored-by: [email protected] <[email protected]>

* update explorer (#887) (#907)

* update

* Update ex-ug-deploy.md

* update-1105

* Update ex-ug-deploy.md

Co-authored-by: 朱晓青 <[email protected]>

Co-authored-by: foesa <[email protected]>
Co-authored-by: 朱晓青 <[email protected]>

* change create sentence in nGQL (#906)

* create and import cluster (#904)

* create and import cluster

* Update 1.what-is-dashboard.md

* add pics

* Create 8.faq.md (#901)

* Create 8.faq.md

* Update 8.faq.md

* cluster operation (#909)

* Update mkdocs.yml

* add license (#903)

* add license

* Update source_install-nebula-graph-by-rpm-or-deb.md

Co-authored-by: cooper-lzy <[email protected]>

* update-1111

* deploy dashboard and account (#893) (#910)

* deploy dashboard and account (#893)

* deploy dashboard and account

* add pics and fix title

* Update 2.deploy-connect-dashboard-en.md

* Update 2.deploy-connect-dashboard-en.md

* Update 2.deploy-connect-dashboard-en.md

* Update 2.deploy-connect-dashboard-en.md

* Update 2.deploy-connect-dashboard-en.md

Co-Authored-By: foesa <[email protected]>
Co-Authored-By: cooper-lzy <[email protected]>

* Update 2.deploy-connect-dashboard-en.md

Co-authored-by: foesa <[email protected]>
Co-authored-by: cooper-lzy <[email protected]>

* fix deploy dashboard (#911)

* update

* Update mkdocs.yml

* Rename 2.deploy-connect-dashboard-en.md to 2.deploy-connect-dashboard-ent.md

* fix pics (#914)

* fix dashboard (#916)

* Update mkdocs.yml (#917)

* update

* Update 2.deploy-connect-dashboard-ent.md

* Update 8.faq.md

* Update 0.FAQ.md

* Update 2.meta-service.md

* Update 1.create-space.md

* Update 2.use-space.md

* Update 2.use-space.md

* Update mkdocs.yml

* Operator new and updates for 261 (#922)

* add crd updates (#919)

Update 8.1.custom-conf-parameter.md (#920)

period typo

* custom-conf-parameters&pv-claim&balance-data (#908)

* custom-conf-parameters&pv-claim&balance-data

* Update 3.1create-cluster-with-kubectl.md

* Update 3.2create-cluster-with-helm.md

* update yaml

* Update 7.operator-faq.md

* update helm

* Update 3.2create-cluster-with-helm.md

* error fix

* Update 8.3.balance-data-when-scaling-storage.md

* Create 9.upgrade-nebula-cluster.md (#913)

* Create 9.upgrade-nebula-cluster.md

* Update 9.upgrade-nebula-cluster.md

* Update 9.upgrade-nebula-cluster.md

* Update 9.upgrade-nebula-cluster.md

* Update 9.upgrade-nebula-cluster.md

* Update 4.connect-to-nebula-graph-service.md (#915)

* Update 4.connect-to-nebula-graph-service.md

* Update 4.connect-to-nebula-graph-service.md

* Update 4.connect-to-nebula-graph-service.md

* Update 4.connect-to-nebula-graph-service.md

* Update mkdocs.yml (#923) (#925)

* Add upgrade cluster to mkdocs 261 (#928)

* Update mkdocs.yml (#923)

* Update mkdocs.yml

* Update mkdocs.yml

* Update 6.eco-tool-version.md

* Update 3.role-list.md

* fixed broken markdown table (#935)

fixed broken markdown table

https://docs.nebula-graph.io/2.6.1/3.ngql-guide/5.operators/5.property-reference/

* Update ex-ug-FAQ.md (#930)

* fix details (#929)

* Update 2.deploy-connect-dashboard-ent.md

* add exchange ent (#932)

* add exchange ent

* add exchange ent docs

* Update ex-ug-compile.md

* add parameters and fix details

* Update ex-ug-what-is-exchange.md

* Update 2.deploy-es.md

* added link of release note (#937)

* Update 2.deploy-dashboard.md (#936)

* Update 2.deploy-dashboard.md

* Update 2.deploy-dashboard.md

* Update mkdocs.yml

* Update ex-ug-what-is-exchange.md

* Update 2.deploy-connect-dashboard-ent.md (#938)

* Update nebula-spark-connector.md (#939)

* Update practice.md (#940)

* Update 6.eco-tool-version.md

java client:https://github.com/vesoft-inc/nebula-java/releases/tag/v2.6.1
nebula exchange:https://github.com/vesoft-inc/nebula-exchange/releases/tag/v2.6.1
nebula spark connector:https://github.com/vesoft-inc/nebula-spark-connector/releases/tag/v2.6.1
nebula flink connector: https://github.com/vesoft-inc/nebula-flink-connector/releases/tag/v2.6.1

* Update comments.md

* Update 2.update-edge.md

* Update mkdocs.yml (#944)

java client:https://github.com/vesoft-inc/nebula-java/releases/tag/v2.6.1
nebula exchange:https://github.com/vesoft-inc/nebula-exchange/releases/tag/v2.6.1
nebula spark connector:https://github.com/vesoft-inc/nebula-spark-connector/releases/tag/v2.6.1
nebula flink connector: https://github.com/vesoft-inc/nebula-flink-connector/releases/tag/v2.6.1

* Update nebula-spark-connector.md (#945)

* Update nebula-spark-connector.md

* Update 6.cheatsheet-for-ngql.md

* Update 1.what-is-dashboard.md

* Update nebula-algorithm.md (#946)

* Update use-importer.md (#947)

* Update 6.cheatsheet-for-ngql.md (#949)

* Update 2.match.md (#950)

* Update 2.match.md

* Update 2.match.md

* update

Co-authored-by: randomJoe211 <[email protected]>
Co-authored-by: min.wu <[email protected]>
Co-authored-by: Sophie-Xie <[email protected]>
Co-authored-by: cooper-lzy <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: abby.huang <[email protected]>
Co-authored-by: Yee <[email protected]>
Co-authored-by: Wey Gu <[email protected]>
  • Loading branch information
9 people authored Dec 1, 2021
1 parent f483a4e commit a0bfc80
Show file tree
Hide file tree
Showing 152 changed files with 2,538 additions and 972 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ The Meta Service stores the schema information. Besides, it performs the additio

For more information on Nebula Graph schema, see [Data model](../2.data-model.md).

### Manages TTL-based data eviction
### Manages TTL information

The Meta Service provides automatic data eviction and space reclamation based on TTL (time to live) options for Nebula Graph.

For more information on TTL, see [TTL options](../../3.ngql-guide/8.clauses-and-options/ttl-options.md).
The Meta Service stores the definition of TTL (Time to Live) options which are used to control data expiration. The Storage Service takes care of the expiring and evicting processes. For more information, see [TTL](../../3.ngql-guide/8.clauses-and-options/ttl-options.md).

### Manages jobs

Expand Down
160 changes: 58 additions & 102 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For more information, see [Data modeling](../1.introduction/2.data-model.md).

In this topic, we will use the following dataset to demonstrate basic CRUD operations.

![The demo dataset](https://docs-cdn.nebula-graph.com.cn/docs-2.0/2.quick-start/dataset-for-crud.png)
![The demo dataset](dataset-for-crud.png)

## Check the machine status in the Nebula Graph cluster

Expand All @@ -41,7 +41,6 @@ nebula> SHOW HOSTS;
| "storaged2" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
| "Total" | __EMPTY__ | __EMPTY__ | 0 | __EMPTY__ | __EMPTY__ |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
Got 4 rows (time spent 1061/2251 us)
```

From the **Status** column of the table in the return results, you can see that all the Storage services are online.
Expand Down Expand Up @@ -110,7 +109,6 @@ To make sure the follow-up operations work as expected, take one of the followin
```ngql
nebula> CREATE SPACE basketballplayer(partition_num=15, replica_factor=1, vid_type=fixed_string(30));
Execution succeeded (time spent 2817/3280 us)
```
2. Check the partition distribution with `SHOW HOSTS` to make sure that the partitions are distributed in a balanced way.
Expand All @@ -125,7 +123,6 @@ To make sure the follow-up operations work as expected, take one of the followin
| "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
| "Total" | | | 15 | "basketballplayer:15" | "basketballplayer:15" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
Got 4 rows (time spent 1633/2867 us)
```
If the **Leader distribution** is uneven, use `BALANCE LEADER` to redistribute the partitions. For more information, see [BALANCE](../8.service-tuning/load-balance.md).
Expand All @@ -134,7 +131,6 @@ To make sure the follow-up operations work as expected, take one of the followin
```ngql
nebula[(none)]> USE basketballplayer;
Execution succeeded (time spent 1229/2318 us)
```
You can use `SHOW SPACES` to check the graph space you created.
Expand All @@ -146,7 +142,6 @@ To make sure the follow-up operations work as expected, take one of the followin
+--------------------+
| "basketballplayer" |
+--------------------+
Got 1 rows (time spent 977/2000 us)
```
## Create tags and edge types
Expand Down Expand Up @@ -174,16 +169,12 @@ Create tags `player` and `team`, edge types `follow` and `serve`. Descriptions a

```ngql
nebula> CREATE TAG player(name string, age int);
Execution succeeded (time spent 20708/22071 us)
nebula> CREATE TAG team(name string);
Execution succeeded (time spent 5643/6810 us)
nebula> CREATE EDGE follow(degree int);
Execution succeeded (time spent 12665/13934 us)
nebula> CREATE EDGE serve(start_year int, end_year int);
Execution succeeded (time spent 5858/6870 us)
```

## Insert vertices and edges
Expand Down Expand Up @@ -219,32 +210,24 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
```ngql
nebula> INSERT VERTEX player(name, age) VALUES "player100":("Tim Duncan", 42);
Execution succeeded (time spent 28196/30896 us)
nebula> INSERT VERTEX player(name, age) VALUES "player101":("Tony Parker", 36);
Execution succeeded (time spent 2708/3834 us)
nebula> INSERT VERTEX player(name, age) VALUES "player102":("LaMarcus Aldridge", 33);
Execution succeeded (time spent 1945/3294 us)
nebula> INSERT VERTEX team(name) VALUES "team200":("Warriors"), "team201":("Nuggets");
Execution succeeded (time spent 2269/3310 us)
nebula> INSERT VERTEX team(name) VALUES "team203":("Trail Blazers"), "team204":("Spurs");
```
* Insert edges representing the relations between basketball players and teams:
```ngql
nebula> INSERT EDGE follow(degree) VALUES "player100" -> "player101":(95);
Execution succeeded (time spent 3362/4542 us)
nebula> INSERT EDGE follow(degree) VALUES "player100" -> "player102":(90);
Execution succeeded (time spent 2974/4274 us)
nebula> INSERT EDGE follow(degree) VALUES "player102" -> "player101":(75);
Execution succeeded (time spent 1891/3096 us)
nebula> INSERT EDGE serve(start_year, end_year) VALUES "player100" -> "team200":(1997, 2016), "player101" -> "team201":(1999, 2018);
Execution succeeded (time spent 6064/7104 us)
nebula> INSERT EDGE follow(degree) VALUES "player101" -> "player100":(95);
nebula> INSERT EDGE follow(degree) VALUES "player101" -> "player102":(90);
nebula> INSERT EDGE follow(degree) VALUES "player102" -> "player100":(75);
nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204":(1999, 2018),"player102" -> "team203":(2006, 2015);
```
## Read data
Expand Down Expand Up @@ -305,30 +288,28 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
### Examples of `GO` statement
* Search for the players that the player with VID `player100` follows.
* Search for the players that the player with VID `player101` follows.
```ngql
nebula> GO FROM "player100" OVER follow;
nebula> GO FROM "player101" OVER follow;
+-------------+
| follow._dst |
+-------------+
| "player101" |
| "player100" |
| "player102" |
+-------------+
Got 2 rows (time spent 12097/14220 us)
```
* Filter the players that the player with VID `player100` follows whose age is equal to or greater than 35. Rename the corresponding columns in the results with `Teammate` and `Age`.
* Filter the players that the player with VID `player101` follows whose age is equal to or greater than 35. Rename the corresponding columns in the results with `Teammate` and `Age`.
```ngql
nebula> GO FROM "player100" OVER follow WHERE properties($$).age >= 35 \
nebula> GO FROM "player101" OVER follow WHERE properties($$).age >= 35 \
YIELD properties($$).name AS Teammate, properties($$).age AS Age;
+-----------------+-----+
| Teammate | Age |
+-----------------+-----+
| "Tony Parker" | 36 |
| "Manu Ginobili" | 41 |
+-----------------+-----+
+--------------+-----+
| Teammate | Age |
+--------------+-----+
| "Tim Duncan" | 42 |
+--------------+-----+
```
| Clause/Sign | Description |
Expand All @@ -337,21 +318,19 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
| `$$` | Represents the target vertices. |
| `\` | A line-breaker. |
* Search for the players that the player with VID `player100` follows. Then Retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.
* Search for the players that the player with VID `player101` follows. Then Retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.
* With a pipe:
```ngql
nebula> GO FROM "player100" OVER follow YIELD dst(edge) AS id | \
nebula> GO FROM "player101" OVER follow YIELD dst(edge) AS id | \
GO FROM $-.id OVER serve YIELD properties($$).name AS Team, \
properties($^).name AS Player;
+-----------+-----------------+
| Team | Player |
+-----------+-----------------+
| "Spurs" | "Tony Parker" |
| "Hornets" | "Tony Parker" |
| "Spurs" | "Manu Ginobili" |
+-----------+-----------------+
+-----------------+---------------------+
| Team | Player |
+-----------------+---------------------+
| "Trail Blazers" | "LaMarcus Aldridge" |
+-----------------+---------------------+
```
|Clause/Sign|Description|
Expand All @@ -367,16 +346,14 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
Once a composite statement is submitted to the server as a whole, the life cycle of the temporary variables in the statement ends.
```ngql
nebula> $var = GO FROM "player100" OVER follow YIELD dst(edge) AS id; \
nebula> $var = GO FROM "player101" OVER follow YIELD dst(edge) AS id; \
GO FROM $var.id OVER serve YIELD properties($$).name AS Team, \
properties($^).name AS Player;
+-----------+-----------------+
| Team | Player |
+-----------+-----------------+
| "Spurs" | "Tony Parker" |
| "Hornets" | "Tony Parker" |
| "Spurs" | "Manu Ginobili" |
+-----------+-----------------+
+-----------------+---------------------+
| Team | Player |
+-----------------+---------------------+
| "Trail Blazers" | "LaMarcus Aldridge" |
+-----------------+---------------------+
```
### Example of `FETCH` statement
Expand Down Expand Up @@ -435,49 +412,41 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
```ngql
nebula> UPDATE VERTEX "player100" SET player.name = "Tim";
Execution succeeded (time spent 3483/3914 us)
nebula> FETCH PROP ON player "player100";
+---------------------------------------------+
| vertices_ |
+---------------------------------------------+
| ("player100" :player{age: 42, name: "Tim"}) |
+---------------------------------------------+
Got 1 rows (time spent 2463/3042 us)
```
* `UPDATE` the `degree` property of an edge and check the result with the `FETCH` statement.
```ngql
nebula> UPDATE EDGE "player100" -> "player101" OF follow SET degree = 96;
Execution succeeded (time spent 3932/4432 us)
nebula> UPDATE EDGE "player101" -> "player100" OF follow SET degree = 96;
nebula> FETCH PROP ON follow "player100" -> "player101";
nebula> FETCH PROP ON follow "player101" -> "player100";
+----------------------------------------------------+
| edges_ |
+----------------------------------------------------+
| [:follow "player100"->"player101" @0 {degree: 96}] |
| [:follow "player101"->"player100" @0 {degree: 96}] |
+----------------------------------------------------+
Got 1 rows (time spent 2205/2800 us)
```
* Insert a vertex with VID `player111` and `UPSERT` it.
```ngql
nebula> INSERT VERTEX player(name, age) VALUES "player111":("Ben Simmons", 22);
Execution succeeded (time spent 2115/2900 us)
Wed, 21 Oct 2020 11:11:50 UTC
nebula> UPSERT VERTEX "player111" SET player.name = "Dwight Howard", player.age = $^.player.age + 11 \
WHEN $^.player.name == "Ben Simmons" AND $^.player.age > 20 \
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 \
YIELD $^.player.name AS Name, $^.player.age AS Age;
+---------------+-----+
| Name | Age |
+---------------+-----+
| Dwight Howard | 33 |
+---------------+-----+
Got 1 rows (time spent 1815/2329 us)
+---------+-----+
| Name | Age |
+---------+-----+
| "David" | 49 |
+---------+-----+
```
## Delete vertices and edges
Expand All @@ -502,15 +471,13 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
* Delete vertices:
```ngql
nebula> DELETE VERTEX "team1", "team2";
Execution succeeded (time spent 4337/4782 us)
nebula> DELETE VERTEX "player111", "team203";
```
* Delete edges:
```ngql
nebula> DELETE EDGE follow "team1" -> "team2";
Execution succeeded (time spent 3700/4101 us)
nebula> DELETE EDGE follow "player101" -> "team204";
```
## About indexes
Expand Down Expand Up @@ -538,15 +505,6 @@ Users can add indexes to tags and edge types with the [CREATE INDEX](../3.ngql-g
REBUILD {TAG | EDGE} INDEX <index_name>;
```
### Examples
Create and rebuild indexes for the `name` property on all vertices with the tag `player`.
```ngql
nebula> CREATE TAG INDEX player_index_0 on player(name(20));
nebula> REBUILD TAG INDEX player_index_0;
```

!!! note
Define the index length when creating an index for a variable-length property. In UTF-8 encoding, a non-ascii character occupies 3 bytes. You should set an appropriate index length according to the variable-length property. For example, the index should be 30 bytes for 10 non-ascii characters. For more information, see [CREATE INDEX](../3.ngql-guide/14.native-index-statements/1.create-native-index.md)
Expand All @@ -557,17 +515,16 @@ Make sure there is an [index](#about_indexes) for `LOOKUP` or `MATCH` to use. If
Find the information of the vertex with the tag `player` and its value of the `name` property is `Tony Parker`.
This example creates the index `player_name_0` on the player name property.
This example creates the index `player_index_1` on the player name property.
```nGQL
nebula> CREATE TAG INDEX player_name_0 on player(name(10));
Execution succeeded (time spent 3465/4150 us)
nebula> CREATE TAG INDEX player_index_1 ON player(name(20));
```

This example rebuilds the index to make sure it takes effect on pre-existing data.

```nGQL
nebula> REBUILD TAG INDEX player_name_0
nebula> REBUILD TAG INDEX player_index_1
+------------+
| New Job Id |
+------------+
Expand All @@ -580,12 +537,12 @@ This example uses the `LOOKUP` statement to retrieve the vertex property.

```nGQL
nebula> LOOKUP ON player WHERE player.name == "Tony Parker" \
YIELD player.name, player.age;
+-------------+---------------+------------+
| VertexID | player.name | player.age |
+-------------+---------------+------------+
| "player101" | "Tony Parker" | 36 |
+-------------+---------------+------------+
YIELD properties(vertex).name AS name, properties(vertex).age AS age;
+-------------+---------------+-----+
| VertexID | name | age |
+-------------+---------------+-----+
| "player101" | "Tony Parker" | 36 |
+-------------+---------------+-----+
```

This example uses the `MATCH` statement to retrieve the vertex property.
Expand All @@ -597,5 +554,4 @@ nebula> MATCH (v:player{name:"Tony Parker"}) RETURN v;
+-----------------------------------------------------+
| ("player101" :player{age: 36, name: "Tony Parker"}) |
+-----------------------------------------------------+
Got 1 rows (time spent 5132/6246 us)
```
Loading

0 comments on commit a0bfc80

Please sign in to comment.