Skip to content

Interface: FieldOpts<T> ​

Defined in: src/schema/field-types.ts:22

Type Parameters ​

T ​

T

Properties ​

required? ​

optional required?: boolean

Defined in: src/schema/field-types.ts:24

Whether the field must be present on create. Defaults to false.


default? ​

optional default?: Thunk<T>

Defined in: src/schema/field-types.ts:26

Default applied when the field is absent on create. Factories run per-create.


validate? ​

optional validate?: (value) => void

Defined in: src/schema/field-types.ts:28

Custom validation hook. Throw an Error to reject; its message surfaces in the error.

Parameters ​

value ​

T

Returns ​

void


unique? ​

optional unique?: boolean

Defined in: src/schema/field-types.ts:30

Create a unique index on this field (via ensureIndexes()).


index? ​

optional index?: boolean

Defined in: src/schema/field-types.ts:32

Create a (non-unique) index on this field (via ensureIndexes()).

Released under the MIT License.