12match.mql 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. -- ============================================================
  2. -- Cypher match 查询测试
  3. -- ============================================================
  4. -- 1. match 所有节点 (已知服务端单节点cypher nil pointer bug)
  5. match (n:test_graph) return n.g_name, n.g_type, n.g_value
  6. /**
  7. onerror(continue)
  8. output()
  9. **/
  10. ;
  11. -- 2. match 带属性过滤 (已知服务端单节点cypher nil pointer bug)
  12. match (n:test_graph) where n.g_value > 25 return n.g_name, n.g_type, n.g_value
  13. /**
  14. onerror(continue)
  15. output()
  16. **/
  17. ;
  18. -- 3. match 多条件 (已知服务端单节点cypher nil pointer bug)
  19. match (n:test_graph) where n.g_type='type_a' and n.g_value>=10 return n.g_name, n.g_type, n.g_value
  20. /**
  21. onerror(continue)
  22. output()
  23. **/
  24. ;
  25. -- 4. match 关系路径
  26. match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
  27. /**
  28. output()
  29. **/
  30. ;
  31. -- 5. match 带关系方向
  32. match (a:test_graph where a.g_name='node_a') -[:connect]-> (b:test_graph) return a, b
  33. /**
  34. output()
  35. **/
  36. ;
  37. -- 6. match 无关系节点 (已知服务端单节点cypher nil pointer bug)
  38. match (n:test_graph) where n.g_name='node_e' return n.g_name, n.g_type, n.g_value
  39. /**
  40. onerror(continue)
  41. output()
  42. **/
  43. ;
  44. -- 7. match 返回特定字段 (已知服务端单节点cypher nil pointer bug)
  45. match (n:test_graph) return n.g_name, n.g_value
  46. /**
  47. onerror(continue)
  48. output()
  49. **/
  50. ;