| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- -- ============================================================
- -- Cypher match 查询测试
- -- ============================================================
- -- 1. match 所有节点
- match (n:test_graph) return n
- /**
- output()
- **/
- ;
- -- 2. match 带属性过滤
- match (n:test_graph) where n.g_value > 25 return n
- /**
- output()
- **/
- ;
- -- 3. match 多条件
- match (n:test_graph) where n.g_type='type_a' and n.g_value>=10 return n
- /**
- output()
- **/
- ;
- -- 4. match 关系路径
- match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
- /**
- output()
- **/
- ;
- -- 5. match 带关系方向
- match (a:test_graph) -[:connect]-> (b:test_graph) where a.g_name='node_a' return a, b
- /**
- output()
- **/
- ;
- -- 6. match 无关系节点
- match (n:test_graph) where n.g_name='node_e' return n
- /**
- output()
- **/
- ;
- -- 7. match 返回特定字段
- match (n:test_graph) return n.g_name, n.g_value
- /**
- output()
- **/
- ;
|