0
votes

In ArangoDB if I have a vertex with multiple classes of edges that are not all contained in a single graph, is there any way to safely delete that vertex with a single command? What is the recommended way to delete such a vertex?

Rephrasing the question: assume I have a document collection D1 and two edge collections, E1 and E2. I create a graph that contains D1 and E1. If I delete a vertex from D1 it will delete the document and the edges connected to D1 of type E1 but not of type E2. Is there a way to delete a vertex and ALL the connecting edges if all those edges are not included within the graph?

More generally, I've read a few related questions but I am confused about when I should be combining multiple classes of edges into a single graph: in particular, the advice here to set up graphs in a way that aligns with the intended graph queries seems contradictory to my perception that I need to combine all types of edges into one graph in order to ensure safe deletion of vertex documents.

1
Does this answer your question? If yes, can you mark the answer as accepted? if not, whats missing?dothebart

1 Answers

4
votes

when using the graphs API to delete vertices the following is guaranteed:

  1. If you remove a vertex from a graph, all it's connected edges in this graph are removed as well.
  2. if you remove a vertex all it's connected edges in all other graphs are removed as well.
  3. EdgeCollections now included in any graphs definition are NOT modified in any way.

so for consistent removing of vertices it is sufficient to reference all edge collections in at least one graph and use the graph api to delete vertices.