问题描述
MATCH (n: learningPaths)
WHERE any(x IN n.modules WHERE x = "any course")
RETURN n
MATCH (n:learningPaths)-[]->(m:modules)
WHERE m.id = "any course"
RETURN n;
我在下面用 .net core API 写
var result = (
await _graphClient.Cypher
.Match(@"(n:learningPaths)-[]->(m:modules)")
.Where<modules>(m => m.id == "any course")
.Return((n)=> n.As<learningPaths>())
.ResultsAsync)
.ToList();
解决方法
你有没有试过只做:
var query = client.Cypher
.Match("MATCH (n:learningPaths)-->(m:modules)")
.Where("any(x IN n.modules WHERE x = 'any course')"
.Return( n => n.As<learningPaths>());