Question

I need to delete a node from a neo4j db but according to the docs all the node's relationships have to be deleted first, so guess I need to get the list of those relationships and then delete them one by one. node.getRelationships(type) returns relationships of a particular type -- but not all relationships of all types. Passing '*' for the type doesn't work.

Is there a simpler way to delete a node, or get a list of relationships?

It looks fairly easy to do this directly in cypher so I can always fall back on that, but I'd like to use the node-neo4j library if possible.

Thanks, Alex

Was it helpful?

Solution

Can you pass node.delete(force=true) for the node? Otherwise, you can call the node.all() function to get all the relationships.

Sorry if the syntax looks wrong, JS/CS is not my native language.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top