Interface ICustomOptions

Typegoose options, mostly for "modelOptions({ options: ICustomOptions })"

Hierarchy

  • ICustomOptions

Properties

allowMixed?: Severity

Allow "mongoose.Schema.Types.Mixed"?

automaticName?: boolean

Enable Automatic Name generation of a model Example: class with name of "SomeClass" and option "collection" of "SC"

will generate the name of "SomeClass_SC"

Default

false
customName?: string | CustomNameFunction

Set the modelName of the class. If it is a function, the function will be executed. The function will override "automaticName". If "automaticName" is true and "customName" is a string, it sets a suffix instead of the whole name.

Default

schemaOptions.collection
disableCaching?: boolean

Disable Caching for this Class if defined via @modelOptions, or disable caching for the getModelForClass / buildSchema / getDiscriminatorModelForClass Does NOT overwrite global disabled caching "undefined" and "false" have the same meaning

Default

false
disableLowerIndexes?: boolean

Disable all lower indexes than this class (works like sch.clone().clearIndexes())

This option DOES NOT get inherited

Default

false

Set the Nested Discriminators on the base of the Discriminators

This option can be used over the prop-option to not have to re-define discriminators if used in multiple classes

enableMergeHooks?: boolean

Enable Merging of Hooks Note: only hooks that can be matched against each-other can be de-duplicated If ICustomOptions.enableMergePlugins and ICustomOptions.enableMergeHooks are both "false", then the global plugins will be automatically applied by typegoose, see https://github.com/Automattic/mongoose/issues/12696

Default

false
enableMergePlugins?: boolean

Enable Overwriting of the plugins on the "to-be" discriminator schema with the base schema's Note: this does not actually "merge plugins", it will overwrite the "to-be" discriminator's plugins with the base schema's If ICustomOptions.enableMergePlugins and ICustomOptions.enableMergeHooks are both "false", then the global plugins will be automatically applied by typegoose, see https://github.com/Automattic/mongoose/issues/12696

Default

false

Generated using TypeDoc