简体   繁体   English

ArangoDB 3.0:未知函数“ TRAVERSAL()”的使用(解析时)

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

I freshly installed ArangoDB 3.0.2 via Homebrew 我通过Homebrew新安装了ArangoDB 3.0.2

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 当我在此链接后运行查询时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. 仅供参考:我确实在ArangoDB 2.8中成功运行了该查询。

All graph-related functions were removed from AQL in 3.0. 在3.0中,所有与图形相关的功能都已从AQL删除
The faster and more flexible AQL graph traversal can be used instead. 可以使用更快,更灵活的AQL图形遍历

There are migration recipes available, see eg https://docs.arangodb.com/3.0/cookbook/AQL/MigratingEdgeFunctionsTo3.html 有可用的迁移方法,请参见例如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. 并非所有食谱的食谱都是最新的,您尝试的食谱是为2.x编写的,但在3.x中不再起作用。 @dothebart just removed the obsolete graph recipes from the cookbook, they will be gone after the next build to stop confusing users. @dothebart刚刚从食谱中删除了过时的图形配方,它们将在下一次构建后消失,以免混淆用户。

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: 以下查询将为示例数据提供相同的结果(所有叶节点=仅大写),但不需要用户定义的AQL函数:

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, ")")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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