Skip to content

Uppercase

@tsed/mongoose

Usage

typescript
import { Uppercase } from "@tsed/mongoose";

See /packages/orm/mongoose/src/types/decorators/uppercase.ts.

Overview

ts
function Uppercase(uppercase?: boolean): PropertyDecorator;

Description

If truthy, Mongoose will add a custom setter that uppercases this string using JavaScript's built-in String#toUpperCase().

Example

typescript
@Model()
export class EventModel {
  @Uppercase()
  field: string;
}

Released under the MIT License.