cypherneo4jclientnodereference

Neo4jClient Return NodeReference from cypher query


I have a query:

 var results = new CypherFluentQuery(_client)
       .Start("n", (NodeReference)0)
       .Match(string.Format("(n)-[:{0}]--(x)", UserBelongsTo.TypeKey))
       .Return<User>("x")
       .Results;

This returns me all of the nodes that match the query of type User. How would I perform the same query but return the NodeReferences for each of those matched Users?


Solution

  • Use:

    .Return<Node<User>>("x")
    

    and it will return the Node which has a Reference property.