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.

FSL reference

Learn: Schema

This guide covers Fauna Schema Language (FSL) syntax and API. For specific FSL schema definitions, see:

Comments

FSL supports single-line and block comments as described in the FQL comments section of the language reference.

Property definition

Property definition syntax has one of the following forms:

Syntax Description

<property> <value>

Sets the property value for the item.

<property> <reference>

Relationship between the enclosing schema item and the referenced item, indicating existence.

<property> <reference> { <configuration> }

Relationship between the enclosing schema item and the referenced item, indicating existence and given a value.

Properties can be unique for a schema item or can be repeated.

Cross-reference

An FSL schema can reference another schema by name. For example, a role schema can reference a collection by name:

// Schema for the `Customer` collection.
collection Customer { ... }

...

// Schema for the `customer` role.
role customer {
  // The role references the above `Customer` collection.
  privileges Customer {
    read
  }
}

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!