From c26be6ebcd62a74b27e670df4abc5916d573acff Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:12:52 +0800 Subject: [PATCH 1/2] properties()-function-reduces-query-performance --- .../6.functions-and-expressions/4.schema.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md index 89a1c26d84f..686d5bce028 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md @@ -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 + + Users can use `properties().` 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. @@ -72,6 +85,10 @@ nebula> GO FROM "player100" OVER follow \ +------------------+ ``` +!!! caution + + Users can use `properties(edge).` 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. From 5bbcb87cdf9c75c9625bcf4b912edd3a2a8cdcb3 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 2 Mar 2023 09:27:46 +0800 Subject: [PATCH 2/2] Update 4.schema.md --- docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md index 686d5bce028..e6dd6f69523 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md @@ -61,7 +61,7 @@ You can also use the property reference symbols (`$^` and `$$`) instead of the ` !!! caution - Users can use `properties().` 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. + You can use `properties().` 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) @@ -87,7 +87,7 @@ nebula> GO FROM "player100" OVER follow \ !!! caution - Users can use `properties(edge).` 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. + You can use `properties(edge).` 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)