nebula icon indicating copy to clipboard operation
nebula copied to clipboard

Return grouped query results

Open guiniao opened this issue 1 year ago • 3 comments

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

guiniao avatar Feb 21 '24 01:02 guiniao

你可以将 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/

QingZ11 avatar Feb 21 '24 03:02 QingZ11

1

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

guiniao avatar Feb 22 '24 01:02 guiniao

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

QingZ11 avatar Feb 22 '24 06:02 QingZ11

这个问题先行关闭了,你如果有其他的问题,可以再开一个 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.

QingZ11 avatar Mar 13 '24 03:03 QingZ11