1
0
Fork 0
arangodb/Documentation/Books/AQL/Functions
Dan Larkin 16a5db1c75 Updated documentation with info about RocksDB/MMFiles differences. 2017-04-19 20:50:25 -04:00
..
Array.mdpp
Date.mdpp
Document.mdpp
Fulltext.mdpp Updated documentation with info about RocksDB/MMFiles differences. 2017-04-19 20:50:25 -04:00
Geo.mdpp Updated documentation with info about RocksDB/MMFiles differences. 2017-04-19 20:50:25 -04:00
Miscellaneous.mdpp add crossreferences that one should use WITH 2017-04-05 11:31:41 +02:00
Numeric.mdpp
README.mdpp
String.mdpp Docs: Fix two minor typos 2016-12-22 15:17:32 +01:00
TypeCast.mdpp

README.mdpp

Functions
=========

AQL supports functions to allow more complex computations. Functions can be
called at any query position where an expression is allowed. The general
function call syntax is:

```js
FUNCTIONNAME(arguments)
```

where *FUNCTIONNAME* is the name of the function to be called, and *arguments*
is a comma-separated list of function arguments. If a function does not need any
arguments, the argument list can be left empty. However, even if the argument
list is empty the parentheses around it are still mandatory to make function
calls distinguishable from variable names.

Some example function calls:

```js
HAS(user, "name")
LENGTH(friends)
COLLECTIONS()
```

In contrast to collection and variable names, function names are case-insensitive, 
i.e. *LENGTH(foo)* and *length(foo)* are equivalent.

### Extending AQL
 
It is possible to extend AQL with user-defined functions. These functions need to
be written in JavaScript, and have to be registered before they can be used in a query.
Please refer to [Extending AQL](../Extending/index.html) for more details.