我想在用户定义的函数中从我的集合中返回一些文档。
/* path/to/file.js */
'use strict';
function dimcity(number)
{
return {FOR d IN Dim_City
FILTER d.id >= number
RETURN d};
}
module.exports = dimcity;
但是它给出了一个错误,所以我如何从用户定义函数的集合中返回一个文档。
答案 0 :(得分:0)
你不应该那样做!该文件指出:
<块引用>不支持修改全局变量,就像从 AQL 用户函数内部读取或更改任何集合的数据一样。
见https://www.arangodb.com/docs/stable/aql/extending-conventions.html#variables-and-side-effects