0

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

Alex Brown
  • 295
  • 3
  • 7

1 Answers1

0

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.

Nicholas
  • 7,403
  • 10
  • 48
  • 76
  • The docs (http://coffeedoc.info/github/thingdom/node-neo4j/master/) recommend not using force=true, but all() does seem to work -- the key is to pass it null for the 'type' param. Thanks! – Alex Brown Feb 21 '13 at 23:28