Search code examples
orientdbvertexorientdb2.2

How to remove an edge connection to a vertex in OrientDB?


I created an HasAddress edge between an User and an Address vertex.

If I remove the HasAddress edge, the User vertex still shows the HasAddress connection, just empty.

enter image description here

Any way of removing it? Is this just a GUI thing?

this doesn't seem to work UPDATE User REMOVE HasAddress


Solution

  • It's not properly a GUI thing, but you can ignore it.

    When you create an edge and connect it to a vertex, OrientDB creates a collection of links (a RIDBAG) as a property of the vertex. When you delete edges, the edge pointer is removed from the collection, but the collection itself is not removed.

    If you really don't like that, you can run an

    UPDATE User REMOVE in_HasAddress 
    
    /* or out_HasAddress if you want to remove the outgoing edges collection */
    

    but PLEASE, make sure that the collections are EMPTY, otherwise you will break the graph consistency (you are using a document API to manipulate the graph).

    My advice is to avoid it in general.