Function

Function methods and properties.

Description

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

Dynamically get the Function by name.

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 name of the Function collection as a string.

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

Instance methods

Method Description

Delete a function.

Verify that a function exists.

Replace function fields.

Update function fields.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!