- 语句 1
- 场景:搜索所有包含某个字符串或字串的点或边
- 具体语句:
match (v) with properties(v) as props, keys(properties(v)) as kk, v limit 10000 where [i in kk where props[i] == “Tony Parker”] return v match ()-[e]->() with e, properties(e) as props, keys(properties(e)) as kk limit 10000 where [i in kk where props[i] == 90] return e
- 适合版本:v3.x
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9936
- 语句 2
- 场景:yield 返回多个标签的所有属性
- 具体语句:
fetch prop on * "vertex_id" yield properties(vertex);
- 适合版本:v3.x
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9912
- 语句 3
- 场景:如何筛选没有出边的点
- 具体语句:
MATCH p=(v1:company)-[*1..10]->(v2:company)-[:SHList]->(v3:person) WHERE id(v1)=="company1" RETURN v3.person.name, p
- 适合版本:v3.x
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9872
- 语句 4
- 场景:获取该子图中边缘的点(入度为 0 的点的集合)
- 具体语句:
#GO GET SUBGRAPH 10 steps FROM "Tim Duncan" IN EdgeType YIELD VERTICES AS nodes | yield $-.nodes[6] #MATCH MATCH (v)<-[:EdgeType*1..10]-(n) WHERE id(v)=="vid" AND NOT (n)<-[:EdgeType]-() RETURN n
- 适合版本:v2.6.1
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9807
- 语句 5
- 场景:两个 MATCH 交并差计算之后如何统计数量
- 具体语句:
MATCH (n:player) RETURN n.player.name AS name UNION MATCH (n:team) RETURN n.team.name AS name
- 适合版本:v3.2.0
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9754
- 语句 6
- 场景:如何限制节点扩展的数量
- 具体语句:
nebula> GO 3 STEPS FROM "player100" \ OVER * \ YIELD properties($).name AS NAME, properties($).age AS Age \ LIMIT [3,3,3];
- 适合版本:v3.0.0
- 语句出处:https://discuss.nebula-graph.com.cn/t/topic/9724/6
1 个赞