@andres,
So, there was nothing wrong in the cypher query.
I dont know why, but cypher delete query does not work for neo4jphp library.
This is how, I was able to delete:-
I used the RETURN statement, to get the Result Set.
->After that, parse that result set to get node ids and store them in an array.
->loop through the array, and for each element i.e. ID, $id(say)
use getNode($id) to get the node,
->for these nodes, use getRelationships($id) to get the relationships. This returns a relationship array.
->loop through this array, use delete() to delete the relationships.
->Outside the relationship loop, use delete() for node to delete the node.
Hope that helps for someone else who is facing the same problem.
On Sunday, 11 November 2012 00:37:56 UTC+5:30, divyanshu das wrote:
because its giving me a error, its not deleting the nodes and relationships.
when I use RETURN, it reurns nodes.
but with DELETE, it doesnt delete them.
This is the error that I am getting:-
Fatal error: Uncaught exception 'Everyman\Neo4j\Exception' with message 'Unable to execute query [400]: Headers: Array ( [Content-Length] => 1351 [Content-Encoding] => UTF-8 [Content-Type] => application/json [Access-Control-Allow-Origin] => * [Server] => Jetty(6.1.25) ) Body: Array ( [message] => Unable to commit transaction [exception] => TransactionFailureException [stacktrace] => Array ( [0] => org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:134) [1] => org.neo4j.cypher.internal.pipes.CommitPipe.createResults(CommitPipe.scala:45) [2] => org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$5$$anonfun$apply$3.apply(ExecutionPlanImpl.scala:104) [3] => org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$5$$anonfun$apply$3.apply(ExecutionPlanImpl.scala:104) [4] => org.neo4j.cypher.PipeExecutionResult.immutableResult(PipeExecutionResult.scala:37) [5] => org.ne in /var/www/new-ui/app/libs/Everyman/Neo4j/Command.php on line 117