diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/14.geo.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/14.geo.md index c82e22e44ff..466df10c7a0 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/14.geo.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/14.geo.md @@ -24,7 +24,7 @@ For descriptions of the geography data types, see [Geography](../3.data-types/10 ## Examples ```ngql -nebula> RETURN ST_ASText(ST_Point(1,1)) +nebula> RETURN ST_ASText(ST_Point(1,1)); +--------------------------+ | ST_ASText(ST_Point(1,1)) | +--------------------------+ diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/7.count.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/7.count.md index 44ace3511cd..21193a64e4f 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/7.count.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/7.count.md @@ -38,12 +38,12 @@ nebula> GO FROM "player101" OVER follow BIDIRECT \ +---------------------+----------+ | $-.Name | count(*) | +---------------------+----------+ -| "Dejounte Murray" | 1 | | "LaMarcus Aldridge" | 2 | | "Tim Duncan" | 2 | | "Marco Belinelli" | 1 | | "Manu Ginobili" | 1 | | "Boris Diaw" | 1 | +| "Dejounte Murray" | 1 | +---------------------+----------+ ``` diff --git a/docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md b/docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md index d164855c82b..079d0a8f57c 100644 --- a/docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md +++ b/docs-2.0/3.ngql-guide/7.general-query-statements/2.match.md @@ -55,7 +55,7 @@ nebula> REBUILD TAG INDEX name; | 121 | +------------+ -nebula> REBUILD EDGE INDEX follow_index +nebula> REBUILD EDGE INDEX follow_index; +------------+ | New Job Id | +------------+ @@ -65,24 +65,24 @@ nebula> REBUILD EDGE INDEX follow_index # The following example makes sure the index is rebuilt successfully. nebula> SHOW JOB 121; -+----------------+---------------------+------------+-------------------------+-------------------------+ -| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | -+----------------+---------------------+------------+-------------------------+-------------------------+ -| 121 | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-05-27T02:18:02.000 | 2021-05-27T02:18:02.000 | -| 0 | "storaged1" | "FINISHED" | 2021-05-27T02:18:02.000 | 2021-05-27T02:18:02.000 | -| 1 | "storaged0" | "FINISHED" | 2021-05-27T02:18:02.000 | 2021-05-27T02:18:02.000 | -| 2 | "storaged2" | "FINISHED" | 2021-05-27T02:18:02.000 | 2021-05-27T02:18:02.000 | -+----------------+---------------------+------------+-------------------------+-------------------------+ ++----------------+---------------------+------------+----------------------------+----------------------------+ +| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | ++----------------+---------------------+------------+----------------------------+----------------------------+ +| 121 | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-05-27T02:18:02.000000 | 2021-05-27T02:18:02.000000 | +| 0 | "storaged1" | "FINISHED" | 2021-05-27T02:18:02.000000 | 2021-05-27T02:18:02.000000 | +| 1 | "storaged0" | "FINISHED" | 2021-05-27T02:18:02.000000 | 2021-05-27T02:18:02.000000 | +| 2 | "storaged2" | "FINISHED" | 2021-05-27T02:18:02.000000 | 2021-05-27T02:18:02.000000 | ++----------------+---------------------+------------+----------------------------+----------------------------+ nebula> SHOW JOB 122; -+----------------+----------------------+------------+-------------------------+-------------------------+ -| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | -+----------------+----------------------+------------+-------------------------+-------------------------+ -| 122 | "REBUILD_EDGE_INDEX" | "FINISHED" | 2021-05-27T02:18:11.000 | 2021-05-27T02:18:11.000 | -| 0 | "storaged1" | "FINISHED" | 2021-05-27T02:18:11.000 | 2021-05-27T02:18:21.000 | -| 1 | "storaged0" | "FINISHED" | 2021-05-27T02:18:11.000 | 2021-05-27T02:18:21.000 | -| 2 | "storaged2" | "FINISHED" | 2021-05-27T02:18:11.000 | 2021-05-27T02:18:21.000 | -+----------------+----------------------+------------+-------------------------+-------------------------+ ++----------------+----------------------+------------+----------------------------+----------------------------+ +| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | ++----------------+----------------------+------------+----------------------------+----------------------------+ +| 122 | "REBUILD_EDGE_INDEX" | "FINISHED" | 2021-05-27T02:18:11.000000 | 2021-05-27T02:18:11.000000 | +| 0 | "storaged1" | "FINISHED" | 2021-05-27T02:18:11.000000 | 2021-05-27T02:18:21.000000 | +| 1 | "storaged0" | "FINISHED" | 2021-05-27T02:18:11.000000 | 2021-05-27T02:18:21.000000 | +| 2 | "storaged2" | "FINISHED" | 2021-05-27T02:18:11.000000 | 2021-05-27T02:18:21.000000 | ++----------------+----------------------+------------+----------------------------+----------------------------+ ``` ### Match vertices @@ -98,14 +98,14 @@ You can use a user-defined variable in a pair of parentheses to represent a vert You can specify a tag with `:` after the vertex in a pattern. ```ngql -nebula> MATCH (v:player) RETURN v; +nebula> MATCH (v:player) \ + RETURN v; +---------------------------------------------------------------+ | v | +---------------------------------------------------------------+ -| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | -| ("player106" :player{age: 25, name: "Kyle Anderson"}) | -| ("player115" :player{age: 40, name: "Kobe Bryant"}) | -+---------------------------------------------------------------+ +| ("player105" :player{age: 31, name: "Danny Green"}) | +| ("player109" :player{age: 34, name: "Tiago Splitter"}) | +| ("player111" :player{age: 38, name: "David West"}) | ... ``` @@ -119,22 +119,25 @@ You can specify a vertex property with `{: }` after the t ```ngql # The following example uses the name property to match a vertex. -nebula> MATCH (v:player{name:"Tim Duncan"}) RETURN v; +nebula> MATCH (v:player{name:"Tim Duncan"}) \ + RETURN v; +----------------------------------------------------+ | v | +----------------------------------------------------+ -| ("player100" :player{name: "Tim Duncan", age: 42}) | +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +----------------------------------------------------+ ``` The `WHERE` clause can do the same thing: ```ngql -nebula> MATCH (v:player) WHERE v.name == "Tim Duncan" RETURN v; +nebula> MATCH (v:player) \ + WHERE v.name == "Tim Duncan" \ + RETURN v; +----------------------------------------------------+ | v | +----------------------------------------------------+ -| ("player100" :player{name: "Tim Duncan", age: 42}) | +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +----------------------------------------------------+ ``` @@ -147,7 +150,9 @@ nebula> MATCH (v:player) WHERE v.name == "Tim Duncan" RETURN v; You can use the VID to match a vertex. The `id()` function can retrieve the VID of a vertex. ```ngql -nebula> MATCH (v) WHERE id(v) == 'player101' RETURN v; +nebula> MATCH (v) \ + WHERE id(v) == 'player101' \ + RETURN v; +-----------------------------------------------------+ | v | +-----------------------------------------------------+ @@ -159,13 +164,14 @@ To match multiple VIDs, use `WHERE id(v) IN [vid_list]`. ```ngql nebula> MATCH (v:player { name: 'Tim Duncan' })--(v2) \ - WHERE id(v2) IN ["player101", "player102"] RETURN v2; + WHERE id(v2) IN ["player101", "player102"] \ + RETURN v2; +-----------------------------------------------------------+ | v2 | +-----------------------------------------------------------+ -| ("player101" :player{name: "Tony Parker", age: 36}) | -| ("player102" :player{name: "LaMarcus Aldridge", age: 33}) | -| ("player101" :player{name: "Tony Parker", age: 36}) | +| ("player101" :player{age: 36, name: "Tony Parker"}) | +| ("player101" :player{age: 36, name: "Tony Parker"}) | +| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | +-----------------------------------------------------------+ ``` @@ -183,12 +189,10 @@ nebula> MATCH (v:player{name:"Tim Duncan"})--(v2) \ +---------------------+ | Name | +---------------------+ +| "Spurs" | | "Tony Parker" | | "LaMarcus Aldridge" | | "Marco Belinelli" | -| "Danny Green" | -| "Aron Baynes" | -+---------------------+ ... ``` @@ -216,12 +220,9 @@ nebula> MATCH (v:player{name:"Tim Duncan"})-->(v2)<--(v3) \ +---------------------+ | Name | +---------------------+ -| "Tony Parker" | -| "Tiago Splitter" | | "Dejounte Murray" | -| "Tony Parker" | | "LaMarcus Aldridge" | -+---------------------+ +| "Marco Belinelli" | ... ``` @@ -233,12 +234,9 @@ nebula> MATCH (v:player{name:"Tim Duncan"})-->()<--(v3) \ +---------------------+ | Name | +---------------------+ -| "Tony Parker" | +| "Dejounte Murray" | | "LaMarcus Aldridge" | -| "Rudy Gay" | -| "Danny Green" | -| "Kyle Anderson" | -+---------------------+ +| "Marco Belinelli" | ... ``` @@ -249,13 +247,13 @@ Connected vertices and edges form a path. You can use a user-defined variable to ```ngql nebula> MATCH p=(v:player{name:"Tim Duncan"})-->(v2) \ RETURN p; -+-------------------------------------------+ -| p | -+-------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------+ +| p | ++--------------------------------------------------------------------------------------------------------------------------------------+ +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:serve@0 {end_year: 2016, start_year: 1997}]->("team204" :team{name: "Spurs"})> | | <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})> | | <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})> | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:serve@0 {end_year: 2016, start_year: 1997}]->("team204" :team{name: "Spurs"})> | -+-------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------+ ``` !!! compatibility "OpenCypher compatibility" @@ -269,13 +267,12 @@ Besides using `--`, `-->`, or `<--` to indicate a nameless edge, you can use a u ```ngql nebula> MATCH (v:player{name:"Tim Duncan"})-[e]-(v2) \ RETURN e; -+---------------------------------------------------------------------------+ -| e | -+---------------------------------------------------------------------------+ -| [:follow "player101"->"player100" @0 {degree: 95}] | -| [:follow "player102"->"player100" @0 {degree: 75}] | -| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] | -+---------------------------------------------------------------------------+ ++-----------------------------------------------------------------------+ +| e | ++-----------------------------------------------------------------------+ +| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] | +| [:follow "player101"->"player100" @0 {degree: 95}] | +| [:follow "player102"->"player100" @0 {degree: 75}] | ... ``` @@ -289,12 +286,9 @@ nebula> MATCH ()-[e:follow]-() \ +-----------------------------------------------------+ | e | +-----------------------------------------------------+ -| [:follow "player113"->"player119" @0 {degree: 99}] | -| [:follow "player130"->"player149" @0 {degree: 80}] | -| [:follow "player149"->"player130" @0 {degree: 80}] | -| [:follow "player136"->"player117" @0 {degree: 90}] | -| [:follow "player142"->"player117" @0 {degree: 90}] | -+-----------------------------------------------------+ +| [:follow "player104"->"player105" @0 {degree: 60}] | +| [:follow "player113"->"player105" @0 {degree: 99}] | +| [:follow "player105"->"player100" @0 {degree: 70}] | ... ``` @@ -340,13 +334,12 @@ You can extend a pattern to match multiple edges in a path. ```ngql nebula> MATCH (v:player{name:"Tim Duncan"})-[]->(v2)<-[e:serve]-(v3) \ RETURN v2, v3; -+------------------------------------+-----------------------------------------------------------+ -| v2 | v3 | -+------------------------------------+-----------------------------------------------------------+ -| ("player204" :team{name: "Spurs"}) | ("player101" :player{name: "Tony Parker", age: 36}) | -| ("player204" :team{name: "Spurs"}) | ("player102" :player{name: "LaMarcus Aldridge", age: 33}) | -| ("player204" :team{name: "Spurs"}) | ("player103" :player{age: 32, name: "Rudy Gay"}) | -+------------------------------------+-----------------------------------------------------------+ ++----------------------------------+-----------------------------------------------------------+ +| v2 | v3 | ++----------------------------------+-----------------------------------------------------------+ +| ("team204" :team{name: "Spurs"}) | ("player104" :player{age: 32, name: "Marco Belinelli"}) | +| ("team204" :team{name: "Spurs"}) | ("player101" :player{age: 36, name: "Tony Parker"}) | +| ("team204" :team{name: "Spurs"}) | ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | ... ``` @@ -360,9 +353,9 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*2]->(v2) \ +-----------------------------------------------------------+ | Friends | +-----------------------------------------------------------+ -| ("player100" :player{name: "Tim Duncan", age: 42}) | -| ("player102" :player{name: "LaMarcus Aldridge", age: 33}) | -| ("player125" :player{name: "Manu Ginobili", age: 41}) | +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +| ("player125" :player{age: 41, name: "Manu Ginobili"}) | +| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | +-----------------------------------------------------------+ ``` @@ -397,11 +390,10 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2) \ +-----------------------------------------------------------+ | Friends | +-----------------------------------------------------------+ -| ("player100" :player{age: 42, name: "Tim Duncan"}) | | ("player101" :player{age: 36, name: "Tony Parker"}) | | ("player125" :player{age: 41, name: "Manu Ginobili"}) | -| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | -+-----------------------------------------------------------+ +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +... ``` You can use the `DISTINCT` keyword to aggregate duplicate results. @@ -412,10 +404,10 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2:player) \ +-----------------------------------------------------------+-----------+ | Friends | count(v2) | +-----------------------------------------------------------+-----------+ -| ("player125" :player{age: 41, name: "Manu Ginobili"}) | 3 | | ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | 1 | | ("player100" :player{age: 42, name: "Tim Duncan"}) | 4 | | ("player101" :player{age: 36, name: "Tony Parker"}) | 3 | +| ("player125" :player{age: 41, name: "Manu Ginobili"}) | 3 | +-----------------------------------------------------------+-----------+ ``` @@ -427,10 +419,10 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*0..3]->(v2:player) \ +-----------------------------------------------------------+-----------+ | Friends | count(v2) | +-----------------------------------------------------------+-----------+ -| ("player125" :player{age: 41, name: "Manu Ginobili"}) | 3 | -| ("player101" :player{age: 36, name: "Tony Parker"}) | 3 | | ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | 1 | | ("player100" :player{age: 42, name: "Tim Duncan"}) | 5 | +| ("player125" :player{age: 41, name: "Manu Ginobili"}) | 3 | +| ("player101" :player{age: 36, name: "Tony Parker"}) | 3 | +-----------------------------------------------------------+-----------+ ``` @@ -444,11 +436,11 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow|serve*2]->(v2) \ +-----------------------------------------------------------+ | v2 | +-----------------------------------------------------------+ -| ("player100" :player{name: "Tim Duncan", age: 42}) | -| ("player102" :player{name: "LaMarcus Aldridge", age: 33}) | -| ("player125" :player{name: "Manu Ginobili", age: 41}) | -| ("player204" :team{name: "Spurs"}) | -| ("player215" :team{name: "Hornets"}) | +| ("team204" :team{name: "Spurs"}) | +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +| ("team215" :team{name: "Hornets"}) | +| ("player125" :player{age: 41, name: "Manu Ginobili"}) | +| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | +-----------------------------------------------------------+ ``` @@ -464,18 +456,18 @@ nebula> MATCH (v:player{name:"Tim Duncan"}) \ +----------------------------------------------------+ | v | +----------------------------------------------------+ -| ("player100" :player{name: "Tim Duncan", age: 42}) | +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +----------------------------------------------------+ nebula> MATCH (v:player{name:"Tim Duncan"})-[e]->(v2) \ RETURN e; -+---------------------------------------------------------------------------+ -| e | -+---------------------------------------------------------------------------+ -| [:follow "player100"->"player101" @0 {degree: 95}] | -| [:follow "player100"->"player125" @0 {degree: 95}] | -| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] | -+---------------------------------------------------------------------------+ ++-----------------------------------------------------------------------+ +| e | ++-----------------------------------------------------------------------+ +| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] | +| [:follow "player100"->"player101" @0 {degree: 95}] | +| [:follow "player100"->"player125" @0 {degree: 95}] | ++-----------------------------------------------------------------------+ ``` ### Retrieve VIDs @@ -551,13 +543,13 @@ Use the `properties()` function to retrieve all properties on a vertex or an edg ```ngql nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ RETURN properties(v2); -+------------------------------------+ -| properties(v2) | -+------------------------------------+ -| {"name":"Spurs"} | -| {"name":"Tony Parker", "age":36} | -| {"age":41, "name":"Manu Ginobili"} | -+------------------------------------+ ++----------------------------------+ +| properties(v2) | ++----------------------------------+ +| {name: "Spurs"} | +| {age: 36, name: "Tony Parker"} | +| {age: 41, name: "Manu Ginobili"} | ++----------------------------------+ ``` ### Retrieve edge types @@ -570,8 +562,8 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e]->() \ +----------+ | type(e) | +----------+ -| "follow" | | "serve" | +| "follow" | +----------+ ``` @@ -582,13 +574,13 @@ Use `RETURN ` to retrieve all the information of the matched paths. ```ngql nebula> MATCH p=(v:player{name:"Tim Duncan"})-[*3]->() \ RETURN p; -+-------------------------------------------------------------------------------------------------+ -| p | -+-------------------------------------------------------------------------------------------------+ -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:serve@0 {end_year: 2019, start_year: 2015}]->("team204" :team{name: "Spurs"})> | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:serve@0 {end_year: 2015, start_year: 2006}]->("team203" :team{name: "Trail Blazers"})> | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:follow@0 {degree: 75}]->("player101" :player{age: 36, name: "Tony Parker"})> | -+-------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| p | ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:serve@0 {end_year: 2019, start_year: 2015}]->("team204" :team{name: "Spurs"})> | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:serve@0 {end_year: 2015, start_year: 2006}]->("team203" :team{name: "Trail Blazers"})> | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})-[:follow@0 {degree: 75}]->("player101" :player{age: 36, name: "Tony Parker"})> | ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ... ``` @@ -615,13 +607,13 @@ Use the `relationships()` function to retrieve all edges in a path. ```ngql nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ RETURN relationships(p); -+-----------------------------------------------------------------------------+ -| relationships(p) | -+-----------------------------------------------------------------------------+ -| [[:follow "player100"->"player101" @0 {degree: 95}]] | -| [[:follow "player100"->"player125" @0 {degree: 95}]] | -| [[:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}]] | -+-----------------------------------------------------------------------------+ ++-------------------------------------------------------------------------+ +| relationships(p) | ++-------------------------------------------------------------------------+ +| [[:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}]] | +| [[:follow "player100"->"player101" @0 {degree: 95}]] | +| [[:follow "player100"->"player125" @0 {degree: 95}]] | ++-------------------------------------------------------------------------+ ``` ### Retrieve path length @@ -631,23 +623,22 @@ Use the `length()` function to retrieve the length of a path. ```ngql nebula> MATCH p=(v:player{name:"Tim Duncan"})-[*..2]->(v2) \ RETURN p AS Paths, length(p) AS Length; -+----------------------------------------------------------------------+--------+ -| Paths | Length | -+----------------------------------------------------------------------+--------+ -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})-[:serve@0 {end_year: 2018, start_year: 2002}]->("team204" :team{name: "Spurs"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})-[:follow@0 {degree: 90}]->("player100" :player{age: 42, name: "Tim Duncan"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:serve@0 {end_year: 2019, start_year: 2018}]->("team215" :team{name: "Hornets"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:serve@0 {end_year: 2018, start_year: 1999}]->("team204" :team{name: "Spurs"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})> | 2 | -| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 95}]->("player100" :player{age: 42, name: "Tim Duncan"})> | 2 | ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+ +| Paths | Length | ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+ | <("player100" :player{age: 42, name: "Tim Duncan"})-[:serve@0 {end_year: 2016, start_year: 1997}]->("team204" :team{name: "Spurs"})> | 1 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})> | 1 | | <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})> | 1 | -+----------------------------------------------------------------------+--------+ +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:serve@0 {end_year: 2018, start_year: 1999}]->("team204" :team{name: "Spurs"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:serve@0 {end_year: 2019, start_year: 2018}]->("team215" :team{name: "Hornets"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 95}]->("player100" :player{age: 42, name: "Tim Duncan"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 90}]->("player102" :player{age: 33, name: "LaMarcus Aldridge"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player101" :player{age: 36, name: "Tony Parker"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})-[:serve@0 {end_year: 2018, start_year: 2002}]->("team204" :team{name: "Spurs"})> | 2 | +| <("player100" :player{age: 42, name: "Tim Duncan"})-[:follow@0 {degree: 95}]->("player125" :player{age: 41, name: "Manu Ginobili"})-[:follow@0 {degree: 90}]->("player100" :player{age: 42, name: "Tim Duncan"})> | 2 | ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+ ``` !!! Performance - In Nebula Graph {{ nebula.release }}, the `MATCH` statement has initially optimized for resource usage and performance. - - Simpler operations can be replaced by `GO`, `LOOKUP`, `|`, and `FETCH`. + In Nebula Graph, the performance and resource usage of the `MATCH` statement have been optimized. But we still recommend to use `GO`, `LOOKUP`, `|`, and `FETCH` instead of `MATCH` when high performance is required. diff --git a/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md b/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md index bbfba8aa15e..03d93e70d4b 100644 --- a/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md +++ b/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md @@ -226,7 +226,7 @@ graphd: ### How to upgrade or update the docker images of Nebula Graph services -1. In the `nebula-docker-compose/docker-compose.yaml` file, change all the `image` values to the required image version. +1. In the `nebula-docker-compose/docker-compose.yaml` file, change all the `image` values to the required image version. 2. In the `nebula-docker-compose` directory, run `docker-compose pull` to update the images of the Graph Service, Storage Service, and Meta Service. @@ -235,7 +235,7 @@ graphd: 3. Run `docker-compose up -d` to start the Nebula Graph services again. -4. After connecting to Nebula Graph with Nebula Console, run `show hosts graph`, `show hosts storage`, or `show hosts meta` to check the version of the responding service respectively. +4. After connecting to Nebula Graph with Nebula Console, run `SHOW HOSTS GRAPH`, `SHOW HOSTS STORAGE`, or `SHOW HOSTS META` to check the version of the responding service respectively. ### `ERROR: toomanyrequests` when `docker-compose pull`