role.delete()

Learn: Roles

We recommend you use FSL to create and update user-defined roles. See Role schema.

Delete a role.

Signature

delete() => { id: id, coll: collection}

Description

This method deletes a document from the Role system collection, and returns a Object with the id and coll identity fields from the deleted role.

Parameters

None

Return value

Type Description

type:NullRole

Document doesn’t exist or is inaccessible. See NullDoc.

Examples

Role.byName("customer")!.delete()
Role.byName("customer") /* 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!