如何从GO中的arango DB中删除顶点并自动删除边?

How to delete a vertex from arango DB in GO and have the edges automatically deleted?

我正在使用 arangodb go 客户端并尝试删除一个顶点并自动删除悬挂边。

arangodb 文档说 about named graphs :

The underlying collections of the named graphs are still accessible using the standard methods for collections. However the graph module adds an additional layer on top of these collections giving you the following guarantees: (...) If you delete a vertex all edges referring to this vertex will be deleted too

如何使用 GO 来利用图形模块的保证?

我创建了一个命名图,其中包含我要从中删除的集合和边集合,但如果我只是从集合中删除,我仍然会得到指向新删除的顶点的悬垂边。

有没有办法使用 AQL 来做到这一点? documentation suggests otherwise:

Deleting vertices with associated edges is currently not handled via AQL while the graph management interface and the REST API for the graph module offer a vertex deletion functionality.

相反,它提供了更复杂的查询来执行相同的操作。 但由于此功能存在于图形 Web 界面上,并且应该存在于 REST API 中,它不应该存在于 arangodb go 驱动程序中吗?我错过了什么吗?

使用命名图的 advantages/guarantees 似乎并不存在。

@TomRegner 建议通过 graph.VertexCollection 访问集合。