Rules and Data Validators

Rules are the building blocks of Appwrite Database collections. Using rules and their validators you are able to structure your project data and make sure you only get the data in the formats you expect to.

Rule Object

Name Type Description
name required string

Rule display name.

key required string

Rule name. No special characters and no spaces.

type required string

Rule key type. Check the rule type lists below for available options.

default required any

Default value for this rule type. Make sure that the default value is able to pass validation in order to avoid errors when skipping optional values.

required required boolean

Decide if this rule is required in order to pass validation.

array required boolean

Decide if this rule is a primitive or an array of values.

Validation Types

Each rule has a validation type. This data types are abstracted to help you get started as quickly as possible.