简体   繁体   中英

Arangodb Graph: Delete vertex collection

I have a question to the graph definition in arangodb. It is a very simple scenario, but i could not find a good solution. I create a graph with vertex collections A,B,C,D. I create an edge collection E. In edge definition I define (E, [A,B], [C,D]). Now i just want to delete vertex collection D. The only way I found is to use _graps collection to find out which vertex collections are connected with E edge and to rebuild the edge definition without D. Only then D will be moved to orphand collections and can be removed with _removeVertexCollection. Looks really dirty.

Thank you, Andrey

It is true that deleting a whole vertex can be a bit annoying using the graph objects due to the checks and balances it uses to enforce that we do not with broken and orphan relationships/vertices. However, since this a multi-model DB, you are not required to use the graph object. Indeed, you could just delete any data from the DB using straight forward delete AQL statements aimed directly to the collection. At that point, of course, it becomes the application responsibility to delete all the related information as needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM