ArangoDB 3.0:使用未知函数“TRAVERSAL()"(解析时) [英] ArangoDB 3.0: Usage of unknown function 'TRAVERSAL()' (while parsing)

查看:30
本文介绍了ArangoDB 3.0:使用未知函数“TRAVERSAL()"(解析时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 Homebrew 新安装了 ArangoDB 3.0.2

当我通过此链接运行查询时 https://docs.arangodb.com/3.0/cookbook/Graph/FindingLeafNodesAql.html#using-the-visitor-from-an-aql-query

发生此错误:

查询:未知函数'TRAVERSAL()'的用法(解析时)

有人可以解释为什么我收到这个错误吗?预先非常感谢您.

仅供参考:我确实在 ArangoDB 2.8 中成功运行了该查询.

解决方案

所有与图形相关的函数都是 在 3.0 中从 AQL 中删除.
可以改用更快、更灵活的AQL图遍历.>

有可用的迁移配方,请参见例如https://docs.arangodb.com/3.0/cookbook/AQL/MigratingEdgeFunctionsTo3.html

并非所有食谱都是最新的,您尝试过的食谱是为 2.x 编写的,在 3.x 中不再适用.@dothebart 刚刚从食谱中删除了过时的图形配方,它们将在下一次构建后消失,以免混淆用户.

对于示例数据

以下查询应为您提供相同的结果(所有叶节点 = 仅大写),但不需要用户定义的 AQL 函数:

FOR v IN 0..10 INBOUND "v/world" e//叶节点 = 没有入站边.//我们可以使用LIMIT 1来优化遍历(我们不关心有多少边)过滤器长度(对于 vv 入站 v e 限制 1 返回 1)== 0RETURN CONCAT(v.name, " (", v.type, ")")

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.

解决方案

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

这篇关于ArangoDB 3.0:使用未知函数“TRAVERSAL()"(解析时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆