Skip to content

Commit a0bfc80

Browse files
foesa-yangrandomJoe211whitewumSophie-Xiecooper-lzy
authored
Merge 2.6.1 (#955)
* 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]>
1 parent f483a4e commit a0bfc80

File tree

152 files changed

+2538
-972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+2538
-972
lines changed

docs-2.0/1.introduction/3.nebula-graph-architecture/2.meta-service.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ The Meta Service stores the schema information. Besides, it performs the additio
4545

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

48-
### Manages TTL-based data eviction
48+
### Manages TTL information
4949

50-
The Meta Service provides automatic data eviction and space reclamation based on TTL (time to live) options for Nebula Graph.
51-
52-
For more information on TTL, see [TTL options](../../3.ngql-guide/8.clauses-and-options/ttl-options.md).
50+
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).
5351

5452
### Manages jobs
5553

docs-2.0/2.quick-start/4.nebula-graph-crud.md

+58-102
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For more information, see [Data modeling](../1.introduction/2.data-model.md).
2323

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

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

2828
## Check the machine status in the Nebula Graph cluster
2929

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

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

175170
```ngql
176171
nebula> CREATE TAG player(name string, age int);
177-
Execution succeeded (time spent 20708/22071 us)
178172
179173
nebula> CREATE TAG team(name string);
180-
Execution succeeded (time spent 5643/6810 us)
181174
182175
nebula> CREATE EDGE follow(degree int);
183-
Execution succeeded (time spent 12665/13934 us)
184176
185177
nebula> CREATE EDGE serve(start_year int, end_year int);
186-
Execution succeeded (time spent 5858/6870 us)
187178
```
188179

189180
## Insert vertices and edges
@@ -219,32 +210,24 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
219210
220211
```ngql
221212
nebula> INSERT VERTEX player(name, age) VALUES "player100":("Tim Duncan", 42);
222-
Execution succeeded (time spent 28196/30896 us)
223-
213+
224214
nebula> INSERT VERTEX player(name, age) VALUES "player101":("Tony Parker", 36);
225-
Execution succeeded (time spent 2708/3834 us)
226-
215+
227216
nebula> INSERT VERTEX player(name, age) VALUES "player102":("LaMarcus Aldridge", 33);
228-
Execution succeeded (time spent 1945/3294 us)
229-
230-
nebula> INSERT VERTEX team(name) VALUES "team200":("Warriors"), "team201":("Nuggets");
231-
Execution succeeded (time spent 2269/3310 us)
217+
218+
nebula> INSERT VERTEX team(name) VALUES "team203":("Trail Blazers"), "team204":("Spurs");
232219
```
233220
234221
* Insert edges representing the relations between basketball players and teams:
235222
236223
```ngql
237-
nebula> INSERT EDGE follow(degree) VALUES "player100" -> "player101":(95);
238-
Execution succeeded (time spent 3362/4542 us)
239-
240-
nebula> INSERT EDGE follow(degree) VALUES "player100" -> "player102":(90);
241-
Execution succeeded (time spent 2974/4274 us)
242-
243-
nebula> INSERT EDGE follow(degree) VALUES "player102" -> "player101":(75);
244-
Execution succeeded (time spent 1891/3096 us)
245-
246-
nebula> INSERT EDGE serve(start_year, end_year) VALUES "player100" -> "team200":(1997, 2016), "player101" -> "team201":(1999, 2018);
247-
Execution succeeded (time spent 6064/7104 us)
224+
nebula> INSERT EDGE follow(degree) VALUES "player101" -> "player100":(95);
225+
226+
nebula> INSERT EDGE follow(degree) VALUES "player101" -> "player102":(90);
227+
228+
nebula> INSERT EDGE follow(degree) VALUES "player102" -> "player100":(75);
229+
230+
nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204":(1999, 2018),"player102" -> "team203":(2006, 2015);
248231
```
249232
250233
## Read data
@@ -305,30 +288,28 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
305288
306289
### Examples of `GO` statement
307290
308-
* Search for the players that the player with VID `player100` follows.
291+
* Search for the players that the player with VID `player101` follows.
309292
310293
```ngql
311-
nebula> GO FROM "player100" OVER follow;
294+
nebula> GO FROM "player101" OVER follow;
312295
+-------------+
313296
| follow._dst |
314297
+-------------+
315-
| "player101" |
298+
| "player100" |
316299
| "player102" |
317300
+-------------+
318-
Got 2 rows (time spent 12097/14220 us)
319301
```
320302
321-
* 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`.
303+
* 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`.
322304
323305
```ngql
324-
nebula> GO FROM "player100" OVER follow WHERE properties($$).age >= 35 \
306+
nebula> GO FROM "player101" OVER follow WHERE properties($$).age >= 35 \
325307
YIELD properties($$).name AS Teammate, properties($$).age AS Age;
326-
+-----------------+-----+
327-
| Teammate | Age |
328-
+-----------------+-----+
329-
| "Tony Parker" | 36 |
330-
| "Manu Ginobili" | 41 |
331-
+-----------------+-----+
308+
+--------------+-----+
309+
| Teammate | Age |
310+
+--------------+-----+
311+
| "Tim Duncan" | 42 |
312+
+--------------+-----+
332313
```
333314
334315
| Clause/Sign | Description |
@@ -337,21 +318,19 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
337318
| `$$` | Represents the target vertices. |
338319
| `\` | A line-breaker. |
339320
340-
* 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.
321+
* 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.
341322
342323
* With a pipe:
343324
344325
```ngql
345-
nebula> GO FROM "player100" OVER follow YIELD dst(edge) AS id | \
326+
nebula> GO FROM "player101" OVER follow YIELD dst(edge) AS id | \
346327
GO FROM $-.id OVER serve YIELD properties($$).name AS Team, \
347328
properties($^).name AS Player;
348-
+-----------+-----------------+
349-
| Team | Player |
350-
+-----------+-----------------+
351-
| "Spurs" | "Tony Parker" |
352-
| "Hornets" | "Tony Parker" |
353-
| "Spurs" | "Manu Ginobili" |
354-
+-----------+-----------------+
329+
+-----------------+---------------------+
330+
| Team | Player |
331+
+-----------------+---------------------+
332+
| "Trail Blazers" | "LaMarcus Aldridge" |
333+
+-----------------+---------------------+
355334
```
356335
357336
|Clause/Sign|Description|
@@ -367,16 +346,14 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
367346
Once a composite statement is submitted to the server as a whole, the life cycle of the temporary variables in the statement ends.
368347
369348
```ngql
370-
nebula> $var = GO FROM "player100" OVER follow YIELD dst(edge) AS id; \
349+
nebula> $var = GO FROM "player101" OVER follow YIELD dst(edge) AS id; \
371350
GO FROM $var.id OVER serve YIELD properties($$).name AS Team, \
372351
properties($^).name AS Player;
373-
+-----------+-----------------+
374-
| Team | Player |
375-
+-----------+-----------------+
376-
| "Spurs" | "Tony Parker" |
377-
| "Hornets" | "Tony Parker" |
378-
| "Spurs" | "Manu Ginobili" |
379-
+-----------+-----------------+
352+
+-----------------+---------------------+
353+
| Team | Player |
354+
+-----------------+---------------------+
355+
| "Trail Blazers" | "LaMarcus Aldridge" |
356+
+-----------------+---------------------+
380357
```
381358
382359
### Example of `FETCH` statement
@@ -435,49 +412,41 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
435412
436413
```ngql
437414
nebula> UPDATE VERTEX "player100" SET player.name = "Tim";
438-
Execution succeeded (time spent 3483/3914 us)
439415
440416
nebula> FETCH PROP ON player "player100";
441417
+---------------------------------------------+
442418
| vertices_ |
443419
+---------------------------------------------+
444420
| ("player100" :player{age: 42, name: "Tim"}) |
445421
+---------------------------------------------+
446-
Got 1 rows (time spent 2463/3042 us)
447422
```
448423
449424
* `UPDATE` the `degree` property of an edge and check the result with the `FETCH` statement.
450425
451426
```ngql
452-
nebula> UPDATE EDGE "player100" -> "player101" OF follow SET degree = 96;
453-
Execution succeeded (time spent 3932/4432 us)
427+
nebula> UPDATE EDGE "player101" -> "player100" OF follow SET degree = 96;
454428
455-
nebula> FETCH PROP ON follow "player100" -> "player101";
429+
nebula> FETCH PROP ON follow "player101" -> "player100";
456430
+----------------------------------------------------+
457431
| edges_ |
458432
+----------------------------------------------------+
459-
| [:follow "player100"->"player101" @0 {degree: 96}] |
433+
| [:follow "player101"->"player100" @0 {degree: 96}] |
460434
+----------------------------------------------------+
461-
Got 1 rows (time spent 2205/2800 us)
462435
```
463436
464437
* Insert a vertex with VID `player111` and `UPSERT` it.
465438
466439
```ngql
467-
nebula> INSERT VERTEX player(name, age) VALUES "player111":("Ben Simmons", 22);
468-
Execution succeeded (time spent 2115/2900 us)
469-
470-
Wed, 21 Oct 2020 11:11:50 UTC
471-
472-
nebula> UPSERT VERTEX "player111" SET player.name = "Dwight Howard", player.age = $^.player.age + 11 \
473-
WHEN $^.player.name == "Ben Simmons" AND $^.player.age > 20 \
440+
nebula> INSERT VERTEX player(name,age) values "player111":("David West", 38);
441+
442+
nebula> UPSERT VERTEX "player111" SET player.name = "David", player.age = $^.player.age + 11 \
443+
WHEN $^.player.name == "David West" AND $^.player.age > 20 \
474444
YIELD $^.player.name AS Name, $^.player.age AS Age;
475-
+---------------+-----+
476-
| Name | Age |
477-
+---------------+-----+
478-
| Dwight Howard | 33 |
479-
+---------------+-----+
480-
Got 1 rows (time spent 1815/2329 us)
445+
+---------+-----+
446+
| Name | Age |
447+
+---------+-----+
448+
| "David" | 49 |
449+
+---------+-----+
481450
```
482451
483452
## Delete vertices and edges
@@ -502,15 +471,13 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
502471
* Delete vertices:
503472
504473
```ngql
505-
nebula> DELETE VERTEX "team1", "team2";
506-
Execution succeeded (time spent 4337/4782 us)
474+
nebula> DELETE VERTEX "player111", "team203";
507475
```
508476
509477
* Delete edges:
510478
511479
```ngql
512-
nebula> DELETE EDGE follow "team1" -> "team2";
513-
Execution succeeded (time spent 3700/4101 us)
480+
nebula> DELETE EDGE follow "player101" -> "team204";
514481
```
515482
516483
## About indexes
@@ -538,15 +505,6 @@ Users can add indexes to tags and edge types with the [CREATE INDEX](../3.ngql-g
538505
REBUILD {TAG | EDGE} INDEX <index_name>;
539506
```
540507
541-
### Examples
542-
543-
Create and rebuild indexes for the `name` property on all vertices with the tag `player`.
544-
545-
```ngql
546-
nebula> CREATE TAG INDEX player_index_0 on player(name(20));
547-
nebula> REBUILD TAG INDEX player_index_0;
548-
```
549-
550508
!!! note
551509
552510
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)
@@ -557,17 +515,16 @@ Make sure there is an [index](#about_indexes) for `LOOKUP` or `MATCH` to use. If
557515
558516
Find the information of the vertex with the tag `player` and its value of the `name` property is `Tony Parker`.
559517
560-
This example creates the index `player_name_0` on the player name property.
518+
This example creates the index `player_index_1` on the player name property.
561519
562520
```nGQL
563-
nebula> CREATE TAG INDEX player_name_0 on player(name(10));
564-
Execution succeeded (time spent 3465/4150 us)
521+
nebula> CREATE TAG INDEX player_index_1 ON player(name(20));
565522
```
566523

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

569526
```nGQL
570-
nebula> REBUILD TAG INDEX player_name_0
527+
nebula> REBUILD TAG INDEX player_index_1
571528
+------------+
572529
| New Job Id |
573530
+------------+
@@ -580,12 +537,12 @@ This example uses the `LOOKUP` statement to retrieve the vertex property.
580537

581538
```nGQL
582539
nebula> LOOKUP ON player WHERE player.name == "Tony Parker" \
583-
YIELD player.name, player.age;
584-
+-------------+---------------+------------+
585-
| VertexID | player.name | player.age |
586-
+-------------+---------------+------------+
587-
| "player101" | "Tony Parker" | 36 |
588-
+-------------+---------------+------------+
540+
YIELD properties(vertex).name AS name, properties(vertex).age AS age;
541+
+-------------+---------------+-----+
542+
| VertexID | name | age |
543+
+-------------+---------------+-----+
544+
| "player101" | "Tony Parker" | 36 |
545+
+-------------+---------------+-----+
589546
```
590547

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

0 commit comments

Comments
 (0)