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 acb640f0ef7..c0853c14c51 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 @@ -20,39 +20,30 @@ MATCH [] RETURN []; - `output`: Define the output to be returned. You can rename the output column by using `AS`. - !!! compatibility "Legacy version compatibility" - - From Nebula Graph version 3.0, patterns support matching multiple tags at the same time, so you need to specify a tag name when querying properties. The original statement `RETURN variable_name.property_name` is changed to `RETURN variable_name..property_name`. - - `clause_2`: The `ORDER BY` and `LIMIT` clauses are supported. -## The workflow of MATCH - -1. The `MATCH` statement uses a native index to locate a source vertex or an edge. The source vertex or the edge can be in any position in the pattern. In other words, in a valid `MATCH` statement, **there must be an indexed property, a tag, or an edge type. Or the VID of a specific vertex must be specified with the id() function in the `WHERE` clause.** For how to create an index, see [create native index](../14.native-index-statements/1.create-native-index.md). - -2. The `MATCH` statement searches through the pattern to match edges or vertices. +## Precautions - !!! note +!!! compatibility "Legacy version compatibility" - The path type of the `MATCH` statement is `trail`. That is, only vertices can be repeatedly visited in the graph traversal. Edges cannot be repeatedly visited. For details, see [path](../../1.introduction/2.1.path.md). + Starting from Nebula Graph version 3.0.0, patterns support matching multiple tags at the same time, so you need to specify a tag name when querying properties. The original statement `RETURN variable_name.property_name` is changed to `RETURN variable_name..property_name`. -3. The `MATCH` statement retrieves data according to the `RETURN` clause. +- The `MATCH` statement retrieves data according to the `RETURN` clause. -## OpenCypher compatibility +- The path type of the `MATCH` statement is `trail`. That is, only vertices can be repeatedly visited in the graph traversal. Edges cannot be repeatedly visited. For details, see [path](../../1.introduction/2.1.path.md). -- For now, nGQL does not support traversing all vertices and edges with `MATCH`, such as `MATCH (v) RETURN v`. However, after the index of a certain tag is created, all corresponding vertices can be traversed, such as `MATCH (v:T1) RETURN v`. +- In a valid `MATCH` statement, the VID of a specific vertex must be specified with the id() function in the `WHERE` clause. There is no need to create an index. -- Graph pattern is not supported in the `WHERE` clause. +- When traversing all vertices and edges with `MATCH`, such as `MATCH (v) RETURN v LIMIT N`, there is no need to create an index, but you need to use `LIMIT` to limit the number of output results. -## Using patterns in MATCH statements +- When traversing all vertices of the specified Tag or edge of the specified Edge Type, such as `MATCH (v:player) RETURN v LIMIT N`, there is no need to create an index, but you need to use `LIMIT` to limit the number of output results. -### Prerequisites +- In addition to the foregoing, make sure there is at least one index in the `MATCH` statement. How to create native indexes, see [CREATE INDEX](../3/../14.native-index-statements/1.create-native-index.md). -Make sure there is at least one index in the `MATCH` statement, or there is a specified VID. If you want to create an index, but there are already related vertices, edges, or properties, you must rebuild indexes after creating the index to make it valid. -!!! caution +## Using patterns in MATCH statements - Correct use of indexes can speed up queries, but indexes can dramatically reduce the write performance. The performance reduction can be as much as 90% or even more. **DO NOT** use indexes in production environments unless you are fully aware of their influences on your service. +### Create indexes ```ngql # The following example creates an index on both the name property of the tag player and the edge type follow. @@ -99,13 +90,30 @@ nebula> SHOW JOB 122; ### Match vertices +!!! compatibility "Legacy version compatibility" + + In Nebula Graph versions earlier than 3.0.0, nGQL does not support `MATCH (v) RETURN v`. As of version 3.0.0, nGQL support `MATCH (v) RETURN v`, there is no need to create an index, but you need to use `LIMIT` to limit the number of output results. + You can use a user-defined variable in a pair of parentheses to represent a vertex in a pattern. For example: `(v)`. +```ngql +nebula> MATCH (v) \ + RETURN v \ + LIMIT 3; ++-----------------------------------------------------------+ +| v | ++-----------------------------------------------------------+ +| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | +| ("player106" :player{age: 25, name: "Kyle Anderson"}) | +| ("player115" :player{age: 40, name: "Kobe Bryant"}) | ++-----------------------------------------------------------+ +``` + ### Match tags !!! note - The prerequisite for matching a tag is that the tag itself has an index or a certain property of the tag has an index. Otherwise, you cannot execute the `MATCH` statement based on the tag. + In Nebula Graph versions earlier than 3.0.0, the prerequisite for matching a tag is that the tag itself has an index or a certain property of the tag has an index. As of version 3.0.0, there is no need to create an index for matching a tag, but you need to use `LIMIT` to limit the number of output results. You can specify a tag with `:` after the vertex in a pattern. @@ -306,34 +314,55 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-->(v2) \ ### Match edges -Besides using `--`, `-->`, or `<--` to indicate a nameless edge, you can use a user-defined variable in a pair of square brackets to represent a named edge. For example: `-[e]-`. +!!! compatibility "OpenCypher compatibility" + + In Nebula Graph versions earlier than 3.0.0, the prerequisite for matching a edge is that the edge itself has an index or a certain property of the edge has an index. As of version 3.0.0, there is no need to create an index for matching a edge, but you need to use `LIMIT` to limit the number of output results and you must specify the direction of the edge. ```ngql -nebula> MATCH (v:player{name:"Tim Duncan"})-[e]-(v2) \ - RETURN e; -+-----------------------------------------------------------------------+ -| e | -+-----------------------------------------------------------------------+ -| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] | -| [:follow "player101"->"player100" @0 {degree: 95}] | -| [:follow "player102"->"player100" @0 {degree: 75}] | -... +nebula> MATCH ()<-[e]-() \ + RETURN e \ + LIMIT 3; ++----------------------------------------------------+ +| e | ++----------------------------------------------------+ +| [:follow "player101"->"player102" @0 {degree: 90}] | +| [:follow "player103"->"player102" @0 {degree: 70}] | +| [:follow "player135"->"player102" @0 {degree: 80}] | ++----------------------------------------------------+ ``` ### Match edge types Just like vertices, you can specify edge types with `:` in a pattern. For example: `-[e:follow]-`. + +!!! compatibility "OpenCypher compatibility" + + In Nebula Graph versions earlier than 3.0.0, the prerequisite for matching a edge type is that the edge type itself has an index or a certain property of the edge type has an index. As of version 3.0.0, there is no need to create an index for matching a edge type, but you need to use `LIMIT` to limit the number of output results and you must specify the direction of the edge. + ```ngql +nebula> MATCH ()-[e:follow]->() \ + RETURN e \ + limit 3; ++----------------------------------------------------+ +| e | ++----------------------------------------------------+ +| [:follow "player102"->"player100" @0 {degree: 75}] | +| [:follow "player102"->"player101" @0 {degree: 75}] | +| [:follow "player129"->"player116" @0 {degree: 90}] | ++----------------------------------------------------+ + +# Before you execute the following statement, you must create an index on the edge type itself or a certain property of the edge type nebula> MATCH ()-[e:follow]-() \ RETURN e; +-----------------------------------------------------+ | e | +-----------------------------------------------------+ -| [:follow "player104"->"player105" @0 {degree: 60}] | -| [:follow "player113"->"player105" @0 {degree: 99}] | -| [:follow "player105"->"player100" @0 {degree: 70}] | -... +| [:follow "player126"->"player116" @0 {degree: 13}] | +| [:follow "player142"->"player117" @0 {degree: 90}] | +| [:follow "player136"->"player117" @0 {degree: 90}] | +| [:follow "player136"->"player148" @0 {degree: 85}] | +··· ``` ### Match edge type properties @@ -530,202 +559,7 @@ nebula> MATCH (v1:player{name:"Tim Duncan"}), (v2:team{name:"Spurs"}) \ +----------------------------------------------------+----------------------------------+ ``` -## Common retrieving operations - -### Retrieve vertex or edge information - -Use `RETURN { | }` to retrieve all the information of a vertex or an edge. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN v; -+----------------------------------------------------+ -| v | -+----------------------------------------------------+ -| ("player100" :player{age: 42, name: "Tim Duncan"}) | -+----------------------------------------------------+ - -nebula> MATCH (v:player{name:"Tim Duncan"})-[e]->(v2) \ - RETURN e; -+-----------------------------------------------------------------------+ -| 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 - -Use the `id()` function to retrieve VIDs. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN id(v); -+-------------+ -| id(v) | -+-------------+ -| "player100" | -+-------------+ -``` - -### Retrieve tags - -Use the `labels()` function to retrieve the list of tags on a vertex. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN labels(v); -+------------+ -| labels(v) | -+------------+ -| ["player"] | -+------------+ -``` - -To retrieve the nth element in the `labels(v)` list, use `labels(v)[n-1]`. The following example shows how to use `labels(v)[0]` to retrieve the first tag in the list. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN labels(v)[0]; -+--------------+ -| labels(v)[0] | -+--------------+ -| "player" | -+--------------+ -``` - -### Retrieve a single property on a vertex or an edge - -Use `RETURN { | }.` to retrieve a single property. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN v.player.age; -+--------------+ -| v.player.age | -+--------------+ -| 42 | -+--------------+ -``` - -Use `AS` to specify an alias for a property. - -```ngql -nebula> MATCH (v:player{name:"Tim Duncan"}) \ - RETURN v.player.age AS Age; -+-----+ -| Age | -+-----+ -| 42 | -+-----+ -``` - -### Retrieve all properties on a vertex or an edge - -Use the `properties()` function to retrieve all properties on a vertex or an edge. - -```ngql -nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ - RETURN properties(v2); -+----------------------------------+ -| properties(v2) | -+----------------------------------+ -| {name: "Spurs"} | -| {age: 36, name: "Tony Parker"} | -| {age: 41, name: "Manu Ginobili"} | -+----------------------------------+ -``` - -### Retrieve edge types - -Use the `type()` function to retrieve the matched edge types. - -```ngql -nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e]->() \ - RETURN DISTINCT type(e); -+----------+ -| type(e) | -+----------+ -| "serve" | -| "follow" | -+----------+ -``` - -### Retrieve paths - -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"})> | -+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -... -``` - -### Retrieve vertices in a path - -Use the `nodes()` function to retrieve all vertices in a path. - -```ngql -nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ - RETURN nodes(p); -+---------------------------------------------------------------------------------------------------------------------+ -| nodes(p) | -+---------------------------------------------------------------------------------------------------------------------+ -| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player204" :team{name: "Spurs"})] | -| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player101" :player{name: "Tony Parker", age: 36})] | -| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player125" :player{name: "Manu Ginobili", age: 41})] | -+---------------------------------------------------------------------------------------------------------------------+ -``` - -### Retrieve edges in a path - -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) | -+-------------------------------------------------------------------------+ -| [[: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 - -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"})-[: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 | -+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+ -``` - -### Retrieve with multiple match +## Retrieve with multiple match Multiple `MATCH` can be used when different patterns have different filtering criteria and return the rows that exactly match the pattern. @@ -742,7 +576,7 @@ nebula> MATCH (m)-[]->(n) WHERE id(m)=="player100" \ +-------------+-------------+-------------+ ``` -### Retrieve with optional match +## Retrieve with optional match See [OPTIONAL MATCH](optional-match.md)。 diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md index be55be73287..9e40c55e122 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md @@ -88,6 +88,48 @@ nebula> MATCH (v:player)-[e]->() \ ... ``` +### Return VIDs + +Use the `id()` function to retrieve VIDs. + +```ngql +nebula> MATCH (v:player{name:"Tim Duncan"}) \ + RETURN id(v); ++-------------+ +| id(v) | ++-------------+ +| "player100" | ++-------------+ + +``` + +### Return Tag + +Use the `labels()` function to return the list of tags on a vertex. + +```ngql +nebula> MATCH (v:player{name:"Tim Duncan"}) \ + RETURN labels(v); ++------------+ +| labels(v) | ++------------+ +| ["player"] | ++------------+ +``` + +To retrieve the nth element in the `labels(v)` list, use `labels(v)[n-1]`. The following example shows how to use `labels(v)[0]` to return the first tag in the list. + +```ngql +nebula> MATCH (v:player{name:"Tim Duncan"}) \ + RETURN labels(v)[0]; ++--------------+ +| labels(v)[0] | ++--------------+ +| "player" | ++--------------+ +``` + + ## Return properties To return a vertex or edge property, use the `{|}.` syntax. @@ -105,6 +147,109 @@ nebula> MATCH (v:player) \ +------------------+--------------+ ``` +Use the `properties()` function to return all properties on a vertex or an edge. + +```ngql +nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ + RETURN properties(v2); ++----------------------------------+ +| properties(v2) | ++----------------------------------+ +| {name: "Spurs"} | +| {age: 36, name: "Tony Parker"} | +| {age: 41, name: "Manu Ginobili"} | ++----------------------------------+ +``` + +## Return edge type + +Use the `type()` function to return the matched edge types. + +```ngql +nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e]->() \ + RETURN DISTINCT type(e); ++----------+ +| type(e) | ++----------+ +| "serve" | +| "follow" | ++----------+ +``` + +### Return paths + +Use `RETURN ` to return 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"})> | ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +... +``` + +### Return vertices in a path + +Use the `nodes()` function to return all vertices in a path. + +```ngql +nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ + RETURN nodes(p); ++---------------------------------------------------------------------------------------------------------------------+ +| nodes(p) | ++---------------------------------------------------------------------------------------------------------------------+ +| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player204" :team{name: "Spurs"})] | +| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player101" :player{name: "Tony Parker", age: 36})] | +| [("player100" :star{} :player{age: 42, name: "Tim Duncan"}), ("player125" :player{name: "Manu Ginobili", age: 41})] | ++---------------------------------------------------------------------------------------------------------------------+ +``` + +### Return edges in a path + +Use the `relationships()` function to return all edges in a path. + +```ngql +nebula> MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) \ + RETURN relationships(p); ++-------------------------------------------------------------------------+ +| relationships(p) | ++-------------------------------------------------------------------------+ +| [[:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}]] | +| [[:follow "player100"->"player101" @0 {degree: 95}]] | +| [[:follow "player100"->"player125" @0 {degree: 95}]] | ++-------------------------------------------------------------------------+ +``` + +### Return path length + +Use the `length()` function to return 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"})-[: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 | ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+ +``` + + + ## Return all elements To return all the elements that this pattern matches, use an asterisk (*).