I have a linked list such that every node has a 'next' relation pointed to the next node, the first node has another relation : 'first' which pointed to it from some category. I'm trying to write a delete function that uses cypher to do so but I keep getting this error :
Received an unexpected HTTP status when executing the request.
The query was: MATCH (c:Cat {id:{id}})-[:Post]->(p:Post{id:{pid}})
My try :
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();