Skip to content

Commit

Permalink
Update 4.fetch.md (#811)
Browse files Browse the repository at this point in the history
* Update 4.fetch.md

* Update 4.fetch.md
  • Loading branch information
izhuxiaoqing authored Oct 18, 2021
1 parent 00f41e4 commit de10062
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs-2.0/3.ngql-guide/7.general-query-statements/4.fetch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# FETCH

<!-- This topic needs to be modified after compulsory use of YIELD in 3.0. Refer to https://confluence.nebula-graph.io/pages/viewpage.action?pageId=10723963 -->

The `FETCH` statement retrieves the properties of the specified vertices or edges.

## OpenCypher Compatibility
Expand All @@ -13,15 +15,16 @@ This topic applies to native nGQL only.
```ngql
FETCH PROP ON {<tag_name>[, tag_name ...] | *}
<vid> [, vid ...]
[YIELD <output>]
[YIELD <return_list> [AS <alias>]];
```

|Parameter|Description|
|:---|:---|
|`tag_name`|The name of the tag.|
|`*`|Represents all the tags in the current graph space.|
|`vid`|The vertex ID.|
|`output`|Specifies the information to be returned. For more information, see [`YIELD`](../8.clauses-and-options/yield.md). If there is no `YIELD` clause, `FETCH` returns all the matched information.|
|`YIELD`|Define the output to be returned. The defined properties and `VertexID` are returned. For details, see [`YIELD`](../8.clauses-and-options/yield.md). If there is no `YIELD` clause, `vertices_` is returned by default, which contains all the information about the vertex. |
|`AS`| Set an alias.|

### Fetch vertex properties by one tag

Expand All @@ -42,9 +45,9 @@ Use a `YIELD` clause to specify the properties to be returned.

```ngql
nebula> FETCH PROP ON player "player100" \
YIELD player.name;
YIELD player.name AS name;
+-------------+--------------+
| VertexID | player.name |
| VertexID | name |
+-------------+--------------+
| "player100" | "Tim Duncan" |
+-------------+--------------+
Expand Down Expand Up @@ -132,7 +135,7 @@ FETCH PROP ON <edge_type> <src_vid> -> <dst_vid>[@<rank>] [, <src_vid> -> <dst_v
|`src_vid`|The VID of the source vertex. It specifies the start of an edge.|
|`dst_vid`|The VID of the destination vertex. It specifies the end of an edge.|
|`rank`|The rank of the edge. It is optional and defaults to `0`. It distinguishes an edge from other edges with the same edge type, source vertex, destination vertex, and rank.|
|`output`|Specifies the information to be returned. For more information, see [`YIELD`](../8.clauses-and-options/yield.md). If there is no `YIELD` clause, `FETCH` returns all the matched information.|
|`YIELD`|Define the output to be returned. The defined properties, `SrcVertexID`, `DstVertexID`, and `rank` are returned. For details, see [`YIELD`](../8.clauses-and-options/yield.md). If there is no `YIELD` clause, `edges_` is returned by default, which contains all the information about the edge. |

### Fetch all properties of an edge

Expand Down

0 comments on commit de10062

Please sign in to comment.