Neo4j Client,如何通过id检索节点?

时间:2016-02-04 13:04:32

标签: neo4j neo4jclient

我试图找出通过id检索节点的方法。

MATCH (n) WHERE ID(n) = {id} RETURN n

,是我使用REST接口的Cypher。 现在使用Neo4j Client for .net的流畅语法,我无法在Neo4J.Cypher命名空间中找到函数名称,例如ALL。 有人知道如何用流利的语法重写该查询吗?

client.Cypher
.Match("(node:Employee)")
.Where(node=>**?**(node)== 3)
.Return(node)

1 个答案:

答案 0 :(得分:3)

代码库中没有ID函数名称,所以你不得不去做旧的skool - 下面的代码仍然使用参数......

client.Cypher
    .Match("(node:Employee)")
    .Where("ID(n) = {idParam}")
    .WithParam("idParam", 3)
    .Return(node => node.As<Employee>());