简体   繁体   中英

Custom visitors and custom expanders in arangodb

Looking at the documentsaton it says that the traversal module (@arangodb/graph/traversal) is deprecated from version 3.4.0. Is there any other way to use custom visitors and expanders in the way that was available in that module?

The only alternative I could find was 'user defined functions': https://www.arangodb.com/docs/stable/aql/extending.html .

Once you have a UDF defined, say userFunc , you could run a query like:

FOR v, e, p in MIN..MAX
INBOUND|OUTBOUND|ANY @startingNode
GRAPH @graph //or edge list
[PRUNE]
[OPTIONS]
LET vProcessed = userFunc(v)
//... further clauses operate on vProcessed

A user function defined this way could potentially visit both nodes and edges, which I'm not sure if the client driver could.

Note: The 'visitor' can only run after the PRUNE clause, due to AQL's permitted syntax schema.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM