Search code examples
graphtraversalarangodb

modify vertex or edges attributes with a Traversal Object in ArangoDB?


is it possible/allowed to use a graph Traversal Object to modify attributes of vertices or edges within the config visitor function ?


Solution

  • Right now the Traversal functionality is read-only due to potential side-effects and deadlock situations. We are improving the traversals at the moment, so this feature will be included soon (it might be in a different way than via the visitor function.

    As a workaround for the current release you could do the following: 1) Write a visitor function that returns everything necessary to know which attributes on which objects have to be modified (e.g. a list of object _id values). In a second request you can update all of these documents.

    2) Write a Foxx microservice that encapsulates both requests, namely: * Start a transaction function with all potential collections (optional) * Execute the traversal and compute the information to update objects. * Update the documents. * Close the transaction function