Get/set the function used to cast arbitrary values to this type.
Sets a default option for this schema type.
Attaches a getter for all instances of this schema type.
Cast val
to this schema type. Each class that inherits from schema type should implement this function.
Sets a default value for this SchemaType.
Adds a getter to this schematype.
Defines this path as immutable. Mongoose prevents you from changing
immutable paths unless the parent document has isNew: true
.
Declares the index options for this schematype.
Set the model that this path refers to. This is the option that populate looks at to determine the foreign collection it should query.
Adds a required validator to this SchemaType. The validator gets added to the front of this SchemaType's validators array using unshift().
Sets default select() behavior for this path.
Adds a setter to this schematype.
Declares a sparse index.
Declares a full text index.
Defines a custom function for transforming this path when converting a document to JSON.
Declares an unique index.
Adds validator(s) for this document path.
The class that Mongoose uses internally to instantiate this SchemaType's options
property.
String representation of what type this is, like 'ObjectID' or 'Number'
True if this SchemaType has a required validator. False otherwise.
The options this SchemaType was instantiated with
The path to this SchemaType in a Schema.
The schema this SchemaType instance is part of
The validators that Mongoose should run to validate properties at this SchemaType's path.
This schema type's name, to defend against minifiers that mangle function names.
Configure which values get casted to true
.
Configure which values get casted to false
.
Default options for this SchemaType
Generated using TypeDoc
SchemaType constructor