C#:在其Where子句中执行包含路径的neo4j Cypher查询

时间:2014-09-14 17:03:12

标签: c#-4.0 neo4j

我正在尝试从c#codeBehind获取给定节点的FOAF节点。密码是

MATCH (current { PRSN_F_Name: 'MyName' })-[:KNOWS*1..2]->(fof) 
WHERE NOT (current)- [:KNOWS]->(fof) 
RETURN fof.PRSN_F_Name

如何使用C#实现此查询?

1 个答案:

答案 0 :(得分:0)

我自己找到了答案......它必须如下:

var q = client.Cypher
            .Match("(current { PRSN_F_Name: '" + txtName.Text + "' })-[:KNOWS*1..2]->(fof)")
            .Where("NOT (current)-[:KNOWS]->(fof)")
            .Return((fof) => fof.As<Person>());

        foreach (var result in q.Results)
        {
            ltrFeedback.Text = ltrFeedback.Text + result.PRSN_F_Name + "<br>";
        }