ArangoDB 3.0: Usage of unknown function 'TRAVERSAL()' (while parsing)

痴心易碎 提交于 2019-12-12 03:09:48

问题


I freshly installed ArangoDB 3.0.2 via Homebrew

When I ran a query following this link https://docs.arangodb.com/3.0/cookbook/Graph/FindingLeafNodesAql.html#using-the-visitor-from-an-aql-query

This error occurred:

Query: usage of unknown function 'TRAVERSAL()' (while parsing)

Could somebody please explain why I got this error? Thank you very much in advance.

FYI: I did run that query successfully in ArangoDB 2.8.


回答1:


All graph-related functions were removed from AQL in 3.0.
The faster and more flexible AQL graph traversal can be used instead.

There are migration recipes available, see e.g. https://docs.arangodb.com/3.0/cookbook/AQL/MigratingEdgeFunctionsTo3.html

Not all cookbook recipes are up-to-date, the one you tried was written for 2.x and does not work anymore in 3.x. @dothebart just removed the obsolete graph recipes from the cookbook, they will be gone after the next build to stop confusing users.

The following query should give you the same result for the example data (all leaf nodes = capitals only), but without the need for a user-defined AQL function:

FOR v IN 0..10 INBOUND "v/world" e
    // leaf node = no inbound edges.
    // We can use LIMIT 1 to optimize the traversal (we don't care how many edges)
    FILTER LENGTH(FOR vv IN INBOUND v e LIMIT 1 RETURN 1) == 0
    RETURN CONCAT(v.name, " (", v.type, ")")


来源:https://stackoverflow.com/questions/38436261/arangodb-3-0-usage-of-unknown-function-traversal-while-parsing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!