Class: CollectionField

CollectionField(setup)

new CollectionField(setup)

Creates a new instance of the CollectionField class.

Parameters:
Name Type Description
setup Object

The setup object.

Properties
Name Type Description
type any

The type of the field.

fieldName string

The name of the field.

ref string

The reference of the field.

required boolean

Indicates if the field is required.

unique boolean

Indicates if the field is unique.

immutable boolean

Indicates if the field is immutable.

isEncrypt boolean

Defines if the field should be saved encrypted on the database.

enum Array.<string>

Array with the allowed options for the field.

refConfig SchemaRefConfig

The configuration for related fields with other collections.

enumLabels object

Array with the allowed options for the field.

default string | number | Object | Array | Date | Buffer | function

If a function was provided, it will execute the function runtime, and the default will be the result of the function.

Source:

Members

isEncrypt :boolean

Indicates if the field is encrypted when saved to database.

Type:
  • boolean
Source:

Methods

toObject() → {Object}

Converts the CollectionField object to a plain JavaScript object.

Source:
Returns:
  • The plain JavaScript object representing the CollectionField.
Type
Object