# Indexed Decorator

Module
import { Indexed } from "@tsed/mongoose"
Source/packages/mongoose/src/decorators/indexed.ts

# Overview

function Indexed(index?: SchemaTypeOpts.IndexOpts | boolean | string): Function;

# Description

Tell Mongoose whether to define an index for the property.

# Example

@Model()
export class EventModel {
  @Indexed()
  field: string;
}
1
2
3
4
5