Skip to content

Expires

@tsed/mongoose

Usage

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

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

Overview

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

Description

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

Example

typescript
@Model()
export class EventModel {
  @Expires('5d')
  field: string;
}

Released under the MIT License.