如何查看一类tag下所有的实体和实体数量

求教 nGQL语句

提问前最好提供相应的版本信息,另外可以先搜一下论坛已有的回答:handshake:

如果tag 没有索引,就创建个索引
然后查询tag下所有的点
look up on tag
查询该tag下所有点的数量就执行
look up on tag|count(*)

文档
https://docs.nebula-graph.io/2.0/3.ngql-guide/14.native-index-statements/1.create-native-index/#create_tagedge_type_indexes
https://docs.nebula-graph.io/2.0/3.ngql-guide/7.general-query-statements/5.lookup/#count_the_numbers_of_vertices_or_edges
如果tag有索引就不用再创建了

1 个赞