Search code examples
orientdb

OriendDB how to solve delete instead of delete vertex problems


Unfortunately I used "delete..." instead of "delete vertex..." in my orient DB to delete some vertexes. so now all of the edges there were connected to these vertexes are still exist and causing problems. explain - there are some vertexes, that related by some edges (that should be deleted if I had used the "delete vertex" command), for these edges, I can see in the "in" and "out" columns values, but for one side of the edge the vertex it point's at doesn't really exist. how can i solve this problem? any why to maybe query for all these edges so I could delete them?

thanks!


Solution

  • You can use (from console, plocal)

    repair database --fix-graph
    

    To execute a plain DELETE (not a DELETE VERTEX) on a vertex or edge document, you have to append UNSAFE to the statement, this is to avoid that you do it by mistake. If it happens to you to actually do it without UNSAFE, then I tend to think that you are using a pretty old version of OrientDB, that did not have this check; if it's the case, I strongly suggest you to upgrade