6
votes

I am trying to use AQL to update the whole node collection , named Nodes, depend on the type of edges they have .

Requirement:

  • Basically, if 2 entity in Nodes has relation type= "Same", they would be updated with unique groupid properties (same for more than 2)
  • This would only run one time in the beginning (to populate groupid)

My concept approach:

  • Use AQL
  • For each entity inside Node, query out all connectable nodes with type=SAME
  • Generate an groupid and Update all of them
  • Write to an lookup object those id
  • For next entity, do a lookup, skip the entity if their id is there.

What I tried

FOR v,e,p
In 1..10
ANY v
EntityRelationTest
OPTIONS {uniqueVertices:"global",bfs:true}
FILTER p.edges[*].relationType[0]== "EQUALS"
UPDATE v WITH { typeName2:"test1"} IN EntityTest 
return NEW

But I am quite new to arangodb AQL, is something like above possible?

1

1 Answers

0
votes

In the end, what I use is a customize traversal object running directly inside Foxx in order to get the best of both world: performance and correctness. It seemed that we cannot do the above with only AQL