On Sat, Apr 28, 2012 at 6:47 PM, Tomas Teicher <tomast...@gmail.com> wrote:
I have tried to delete one of relationships. I am using cypher with syntax from this tutorial
start n = node(21) match n-[r]->() �delete r
but it doesn't work. It got me this error: "expected return clause". The error message is pointed to the word "match"
When I change query to return relationships �instead of delete them, it works:�
start n = node(21) match n-[r]->() �return r
This query return me two rows.I am using cypher version 1.8
Can anybody help, what can be problem?
I am using cypher 1.8. When I create or update node, it works. I just cannot delete them
Here is my code and whole error message:
String query = "START n = node(5) MATCH n-[r:HAS_SUBTASK]->subtask delete r";
ExecutionResult result = Neo4jAPI.engine.execute(query);
Exception in thread "main" expected return clause
at org.neo4j.cypher.internal.parser.v1_8.CypherParserImpl.parse(CypherParserImpl.scala:43)
at org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:61)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:61)
at org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:31)
at org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:61)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:52)
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:63)
When I change the query so it would return relationship instead of delete it, it returns one row, so data are ok.
thanks for any help
Tomas
Dňa 28. 4. 2012 19:50, Andres Taylor wrote / napísal(a):
On Sat, Apr 28, 2012 at 6:47 PM, Tomas Teicher <tomast...@gmail.com> wrote:
I have tried to delete one of relationships. I am using cypher with syntax from this tutorial
start n = node(21) match n-[r]->() delete r
but it doesn't work. It got me this error: "expected return clause". The error message is pointed to the word "match"
When I change query to return relationships instead of delete them, it works:
start n = node(21) match n-[r]->() return r
This query return me two rows.I am using cypher version 1.8
Can anybody help, what can be problem?
On Sat, Apr 28, 2012 at 6:47 PM, Tomas Teicher <tomast...@gmail.com> wrote:
I have tried to delete one of relationships. I am using cypher with syntax from this tutorial
start n = node(21) match n-[r]->() �delete r
but it doesn't work. It got me this error: "expected return clause". The error message is pointed to the word "match"
When I change query to return relationships �instead of delete them, it works:�
start n = node(21) match n-[r]->() �return r
This query return me two rows.I am using cypher version 1.8
Can anybody help, what can be problem?
I am using 1.8 library. I can update and create nodes with cypher successfully. I think it is not possible with 1.7 or earlier. As I know, mutating is possible only in 1.8
Maybe I am not using just 1.8 syntax, as you wrote. But then, where can I find current syntax?
thanks for answer
Tomas
Dňa 28. 4. 2012 19:50, Andres Taylor wrote / napísal(a):
On Sat, Apr 28, 2012 at 6:47 PM, Tomas Teicher <tomast...@gmail.com> wrote:
I have tried to delete one of relationships. I am using cypher with syntax from this tutorial
start n = node(21) match n-[r]->() delete r
but it doesn't work. It got me this error: "expected return clause". The error message is pointed to the word "match"
When I change query to return relationships instead of delete them, it works:
start n = node(21) match n-[r]->() return r
This query return me two rows.I am using cypher version 1.8
Can anybody help, what can be problem?