Search code examples
python-2.7neo4jneo4jrestclient

How to delete relationships in Neo4j using python neo4j-rest-client library?


I am not able to find the API to delete relationships from a Node, I could only find a create method. Please let me know how I can delete it.


Solution

  • Don't know exactly about the python library but my understanding is that it mimics the Java API.

    In Java API you'd use:

    for (Relationship r: myNode.getRelationships()) {
        r.delete();
    }
    

    I guess the same concept is valid for python's neo4jrestclient as well: get all relationships of a node and call the delete() method on them.