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.

enum Array.<string>

Array with the allowed options for the field.

enumLabels object

Array with the allowed options for the field.

refConfig SchemaRefConfig

The configuration for related fields with other collections.

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

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

Source:

Methods

toObject() → {Object}

Converts the CollectionField object to a plain JavaScript object.

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