Function methods and properties.


User-defined Function (UDFs) exist as top-level objects in the FQL global namespace. Each Function object has a UDF document stored in a Fauna database that has an FQL expression.

The Function object provides methods to query or create UDF documents.

The Function.create() method can optionally specify a built-in or user-defined Role. The UDF runs with the privileges of the role field. A UDF without a role assigned has the same privileges as the function caller. While not specifying a role on create() may be acceptable, it can result in an ambiguous security policy. It is prudent to ensure that every UDF has an associated role.

Document definition: Function document definition

See User-defined functions in the migration document for FQL v10 and FQL v4 UDF interoperability.

Static methods

Method Description

Get the Set of all accessible user-defined Function documents.

Get a user-defined Function document by its name.

Create a user-defined Function document.

Get the first matching accessible user-defined Function document.

Get the Set of matching accessible user-defined Function documents.

Instance properties

Field Description

Get the user-defined Function definition document.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email

Thank you for your feedback!