# Decorator Expires

Decorator mongoose property
Module
import { Expires } from "@tsed/mongoose"
Source/packages/mongoose/src/decorators/expires.ts

# Overview

function Expires(expires: number | string | Date): PropertyDecorator;

# Description

Defines a TTL index on this path. Only allowed for dates.

# Example

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

Other topics