Skip to content

Commit

Permalink
subgraph: add filter condition example (#2310)
Browse files Browse the repository at this point in the history
* subgraph: add filter condition example

* chore: spacing fix

* format: line break added
  • Loading branch information
wey-gu authored Nov 12, 2022
1 parent bcec7e5 commit 2cc3381
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204":

![GET SUBGRAPH FROM "101" OUT serve](https://docs-cdn.nebula-graph.com.cn/figures/subgraph-2-22-5-7.png)

- 查询从点`player101`开始、0~2 跳、`follow`类型边`degree`大于 90,年龄大于 30 的子图,同时展示边的属性。

```ngql
nebula> GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" \
WHERE follow.degree > 90 AND $$.player.age > 30 \
YIELD VERTICES AS nodes, EDGES AS relationships;
+-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| nodes | relationships |
+-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [("player101" :player{age: 36, name: "Tony Parker"})] | [[:follow "player101"->"player100" @0 {degree: 95}], [:follow "player101"->"player125" @0 {degree: 95}], [:follow "player100"->"player101" @0 {degree: 95}]] |
| [("player125" :player{age: 41, name: "Manu Ginobili"}), ("player100" :player{age: 42, name: "Tim Duncan"})] | [[:follow "player100"->"player125" @0 {degree: 95}]] |
+-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

## FAQ

### 为什么返回结果中会出现超出`step_count`跳数之外的关系?
Expand Down

0 comments on commit 2cc3381

Please sign in to comment.