- 语句 1
- 场景:如何合并两个子图
- 具体语句:
get subgraph 5 step from pod in have,belong yield vertices as nodes, edges as relationshiops union all get subgraph 5 step from pod out have,belong yield vertices as nodes, edges as relationshiops
- 适合版本:v3.3.1
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/11503
- 语句 2
- 场景:自定义排序规则
- 具体语句:
MATCH (a)-[e1]->(b)-[e2]->(c) WITH e1.cost+e2.cost as cost, c ORDER BY cost RETURN c
- 适合版本:v2.x 和 v3.x
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/11453
- 语句 3
- 场景:一跳,返回这个点的所有连接到的点,然后这个连接到的点, 进行一个分组限制每种类型只返回10个,然后每种类型的10个点进行二跳
- 具体语句:
MATCH (a)-[b]->(c) where id(a)="*****" WITH labels(c) AS ctype, collect(distinct c)[0..10] AS c_with_same_type UNWIND c_with_same_type AS cc OPTIONAL MATCH (cc)-[d]->(e) RETURN cc, d, e
- 适合版本:v3.4.0
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/11419
1 个赞