如何从arangodb udf中的集合返回数据

时间:2021-08-01 08:36:34

标签: arangodb

我想在用户定义的函数中从我的集合中返回一些文档。

/* path/to/file.js */
'use strict';


function dimcity(number)
{   
return {FOR d IN Dim_City 
FILTER d.id >= number 
RETURN d};

}

module.exports = dimcity;

但是它给出了一个错误,所以我如何从用户定义函数的集合中返回一个文档。

1 个答案:

答案 0 :(得分:0)

你不应该那样做!该文件指出:

<块引用>

不支持修改全局变量,就像从 AQL 用户函数内部读取或更改任何集合的数据一样。

https://www.arangodb.com/docs/stable/aql/extending-conventions.html#variables-and-side-effects

相关问题