-- ============================================================ -- Cypher 子查询测试 -- ============================================================ -- 1. Cypher 子查询 - where in match (已知解析器不支持 CypherCtrl 级别的 where + 子查询) match (a:test_graph) -[:connect]-> (b:test_graph) where a.g_name in (match (n:test_graph) where n.g_type='type_a' return n.g_name) return a, b /** onerror(continue,'expected [') output() **/ ; -- 2. Cypher 嵌套子查询 (已知服务端单节点cypher不支持) match (a:test_graph) where a.g_value = (match (n:test_graph) where n.g_name='node_c' return max(n.g_value)) return a.g_name, a.g_type, a.g_value /** onerror(continue,'unsupport single node','expected') output() **/ ; -- 3. Cypher 聚合子查询 (已知服务端单节点cypher不支持) match (a:test_graph) where a.g_type='type_a' return a.g_type, count(*) /** onerror(continue,'unsupport single node') output() **/ ; -- 4. Cypher 带 limit 的子查询 (已知服务端单节点cypher不支持) match (a:test_graph) return a.g_name, a.g_type, a.g_value limit 3 /** onerror(continue,'unsupport single node') output() **/ ;