SchemaType.set()

Parameters
  • option «String» The name of the option you’d like to set (e.g. trim, lowercase, etc…)

  • value «*» The value of the option you’d like to set.

Returns:
  • «void»

Sets a default option for this schema type.

Example:

  1. // Make all strings be trimmed by default
  2. mongoose.SchemaTypes.String.set('trim', true);