Skip to content

Commit

Permalink
properties()-function-reduces-query-performance (#1978)
Browse files Browse the repository at this point in the history
* properties()-function-reduces-query-performance

* Update 4.schema.md
  • Loading branch information
abby-cyber authored Mar 2, 2023
1 parent 9547425 commit 62082f1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ nebula> LOOKUP ON player WHERE player.age > 45 \
+-------------------------------------+
```

You can also use the property reference symbols (`$^` and `$$`) instead of the `vertex` field in the `properties()` function to get all properties of a vertex.

- `$^` represents the data of the starting vertex at the beginning of exploration. For example, in `GO FROM "player100" OVER follow reversely YIELD properties($^)`, `$^` refers to the vertex `player100`.

- `$$` represents the data of the end vertex at the end of exploration.

`properties($^)` and `properties($$)` are generally used in `GO` statements. For more information, see [Property reference](../5.operators/5.property-reference.md).

!!! caution

You can use `properties().<property_name>` to get a specific property of a vertex. However, it is not recommended to use this method to obtain specific properties because the `properties()` function returns all properties, which can decrease query performance.


### properties(edge)

properties(edge) returns the properties of an edge.
Expand All @@ -72,6 +85,10 @@ nebula> GO FROM "player100" OVER follow \
+------------------+
```

!!! caution

You can use `properties(edge).<property_name>` to get a specific property of an edge. However, it is not recommended to use this method to obtain specific properties because the `properties(edge)` function returns all properties, which can decrease query performance.

### type(edge)

type(edge) returns the edge type of an edge.
Expand Down

0 comments on commit 62082f1

Please sign in to comment.