vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability

Home Page:https://nebula-graph.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return grouped query results

guiniao opened this issue · comments

查询图数据中所有数据并返回,返回结果中,将有关系的节点放在一起返回,比如是一个数组,主要是一簇一簇的数据放在一起容易清洗。使用简单的 MATCH (n) -[e]-> (m) RETURN n,e,m,返回的结果是随机的,有关系的节点不在一起。使用group by好像也实现不了。请问雨哦其他方法吗

你可以将 limit 和 offset 组合使用达到分页的效果,参考文档:https://docs.nebula-graph.com.cn/3.6.0/3.ngql-guide/8.clauses-and-options/limit/

You can use the combination of LIMIT and OFFSET to achieve pagination. refer docs: https://docs.nebula-graph.io/3.6.0/3.ngql-guide/8.clauses-and-options/limit/

1

@QingZ11 ,你好,请看下图片,我想实现根据圈中每个组的数据一起返回,就是整个图书库中,有关系的一组一组数据一起返回,这样好知道哪些节点之间是有关系的,通过limit和offset能实现吗

这个和分页功能没啥关系,你是想聚集一些结果之后返回。🤔 你可以用 match 语句,在边类型里加上你想要筛选的那几个类型。参考这个:https://docs.nebula-graph.com.cn/3.6.0/3.ngql-guide/7.general-query-statements/2.match/#edge_type_2

这个问题先行关闭了,你如果有其他的问题,可以再开一个 issue 来交流,谢谢 guiniao

This issue will be closed for now. If you have any other problems, please feel free to open another issue to discuss. Thank you.