How to use AQL functions inside user defined functions?

Viewed 466

Is it possible to use standard AQL functions inside a user-defined function ?

I tried to call IS_IN_POLYGON() inside a custom function and got this error at execution time :

Query: AQL: in function 'GEO::IS_IN_MULTIPOLYGON()': user function runtime error: ReferenceError: IS_IN_POLYGON is not defined at (…)

Is there any prefix / require() / anything, that should be used to access standard AQL functions ?

ArangoDB version : 3.2.4

Engine : RocksDB

2 Answers

Answering my own question here.

One can use AQL functions inside a user defined function this way : (example for fictitious SOME_AQL_FUNCTION() returning a boolean)

let result = AQL_QUERY("RETURN SOME_AQL_FUNCTION(…)").json[0];

Found that reading some test code on ArangoDB's GitHub.

Related