Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

functionDef.delete()

Learn: User-defined functions (UDFs)

We recommend you use FSL to create and update user-defined functions (UDFs). See FSL function schema.

Signature

delete() => NullFunctionDef

Description

Deletes a user-defined function (UDF), represented as a Function document.

Function documents are FQL versions of a database’s FSL function schema. Function documents have the FunctionDef type. See User-defined functions (UDFs).

Staged schema

You can’t delete a function while a database has staged schema.

If the database has no staged schema, using this method is equivalent to making an unstaged schema change. Changes are applied immediately to the database’s active schema.

Avoid concurrent schema changes

Concurrent unstaged schema changes can cause contended transactions, even if the changes affect different resources. This includes unstaged changes made using:

A schema change triggers a transaction that validates the entire database schema. To avoid errors, do one of the following instead:

Parameters

None

Return value

Type Description

NullFunctionDef

Document doesn’t exist. See NullDoc.

Examples

Function.byName("checkout")?.delete()
Function.byName("checkout") /* deleted */

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!