Skip to content

Indexed

@tsed/mongoose

Usage

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

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

Overview

ts
function Indexed(index?: IndexOptions | boolean | string): PropertyDecorator;

Description

Tell Mongoose whether to define an index for the property.

Example

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

Released under the MIT License.