Skip to content

Schema properties

String

Stores a JSON string.

Example:

aeria-properties
name str

format

Test.

mask

A mask or array of masks. Example:

aeria-properties
phone str @mask(["(##) #####-####"])

Number

Stores a JSON number.

Example:

aeria-properties
name num

Integer

Stores a JSON number.

Example:

aeria-properties
name int

Boolean

Stores a JSON boolean.

Example:

aeria-properties
is_active bool

Date

Stores a JSON boolean.

Example:

aeria-properties
is_active bool

Datetime

Stores a JSON boolean.

Example:

aeria-properties
is_active bool

Object

Represents a nested object.

Example:

aeria-properties
details {
  properties {
    weight num
  }
}

Reference

Represents a link to a document of another or the same collection. In the database, a ObjectId BSON object is stored.

Example:

aeria-properties
created_by User

Array

Properties prefixed with an [] are turned into an array. For example, if you wish to have an array of strings, write []str.

Example:

aeria-properties
comments []{
  properties {
    text str
    liked_by []User
  }
}

A special syntax is used to add array constraints.

You may specify a range of minimum and maximum allowed array elements like so:

  • [1..3]: minimum 1 element, maximum 3 elements
  • [1..]: minimum 1 element, no maximum limit
  • [@uniqueItems]: elements can not repeat within the array
  • [1.. @uniqueItems]: minimum 1 element, no maximum limit, elements can not repeat within the array

Released under the MIT License.