简体   繁体   中英

How to get all labels for a specific node from neo4j in c#

MATCH (user:Answer)-[r]->(n) WHERE user.AnsID = 1 RETURN n

MATCH (n) WHERE n.ansid = 2 RETURN labels(n),n

我想要将这些密码代码转换为C#查询的帮助吗?

The Neo4jClient examples page should be of great help to you.

For your specific queries, these should work:

graphClient.Cypher
    .Match("(user:Answer)-[r]-(n)")
    .Where((Answer user) => user.AnsID == 1)
    .Return(user => user.As<Answer>())
    .Results

graphClient.Cypher
    .Match("(user:Answer)")
    .Where((Answer user) => user.AnsID == 2)
    .Return(user => new {
      Labels = user.Labels(),
      N = user.As<Answer>()
    })
    .Results

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM