Deleting nodes via neo4j_client library doesn't work

31 views Asked by At

I am working on an Ubuntu application, which shall create and delete nodes depending on the local file system content.

I am initializing the connection using

_pSession = neo4j_connect(oss.str().c_str(), NULL, NEO4J_INSECURE);

running the query

Match (n) WHERE id(n) = 193 detach delete n

doesn't fail, but also doesn't delete the node.

neo4j_update_counts returns:

nodes_created 0 nodes_deleted 0 relationships_created 0 relationships_deleted 0 labels_added 0 labels_removed 0

Running the same command in the browser deletes the node. I can also read and create nodes in this session, why can't I delete nodes? Is there a configuration / initialization issue?

Thanks a lot for support!

1

There are 1 answers

0
dschens_wa On

Found my onw mistake! There query I build with ostringstream. The stream content I did convert to neo4js run statement parameter (const char*) by calling query.str().c_str() This is not a valid call, as the resulting string will be be uninitialized. Bottomline: the query was broken!