I am trying to figure out how to update edge documents using a graph traversal query in arangodb. I am able to do this using the standard
FOR e IN collectionName UPDATE e with {newProps} IN collectionName
. However I cannot figure out what is wrong with my attempt to accomplish the same thing using the
FOR v, e, p IN 1..5 OUTBOUND @startId GRAPH @graphName
syntax.
I am using the arangodb:latest docker image on macOS Mojave 10.14.3, and I am using arango's go library (github.com/arangodb/go-driver) to query by building a query string and sending it using the Database.Query() function. I have tried just returning the key for the edge I'm trying to update (i.e. just returning e._key
instead of attempting to update in the query below), and have verified using arangosh that that is indeed the correct key of the edge I'm trying to update. Additionally as stated above, I have been able to update an edge using the relational AQL syntax.
Here is my query:
FOR v, e, p IN 1..5 OUTBOUND @startId GRAPH @graphName
FILTER e.@key0 == @val0
UPDATE e._key WITH {@propName0: @propValue0} IN has_skill
RETURN {new: NEW, old: OLD}
and here are my bind variables:
[graphName:Matthew_Loughney, key0:_from, propName0:testProp, propValue0:testVal, startId:applicant/232, val0:applicant/232]
I would expect that when I view the has_skill
collection using arangosh, I would see that my edge now has a property testProp
with value testVal
; however, I instead just get the error AQL: document not found (while executing)
and my edge remains unchanged.