仅当存在类似关系时才创建关系-neo4j

仅当存在类似关系时才创建关系-neo4j,neo4j,cypher,neo4jclient,Neo4j,Cypher,Neo4jclient,我有一个链表,这样每个节点都有一个指向下一个节点的“下一个”关系,第一个节点有另一个关系:“第一个”从某个类别指向它。我正在尝试编写一个使用cypher的删除函数,但我一直遇到以下错误: Received an unexpected HTTP status when executing the request. The query was: MATCH (c:Cat {id:{id}})-[:Post]->(p:Post{id:{pid}}) 我的尝试: gclient.

我有一个链表,这样每个节点都有一个指向下一个节点的“下一个”关系,第一个节点有另一个关系:“第一个”从某个类别指向它。我正在尝试编写一个使用cypher的删除函数,但我一直遇到以下错误:

Received an unexpected HTTP status when executing the request.
The query was: MATCH (c:Cat {id:{id}})-[:Post]->(p:Post{id:{pid}})
我的尝试:

        gclient.Cypher
               .Match("(c:Cat {id:{id}})-[:Post]->(p:Post{id:{pid}})")
               .Match("(p)-[nn:next]->(np:Post)")
               .OptionalMatch("(c)-[old:first]->(p)")
               .OptionalMatch("(ppost:Post)-[pn:next]->(p)")
               .WithParams((new
               {
                   id = catId,
                   pid = postId
               }))
               .Create("(ppost)-[:next]->(np)")
               .With("old, p, c, np")
               .Where("old IS NOT NULL")
               .Create("(c)-[:first]->(np)")
               .With("p, old")
               .Delete("old")
               .Delete("p")
               .ExecuteWithoutResults();

如果我不得不猜测的话,我会说错误来自neo4jclient。也许可以尝试在Neo4j web控制台中复制该密码,看看是否可以看到来自密码的错误消息?我认为错误在那里,因为
p
节点仍然有其他关系,可能是一个未删除的传出下一个。