Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 4.fetch.md #811

Merged
merged 2 commits into from
Oct 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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