Skip to content

ObjectID

@tsed/mongoose

Usage

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

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

Overview

ts
function ObjectID(name?: string): any;
export type ObjectID = Types.ObjectId;

Description

Tell Mongoose whether to define an ObjectId property.

Example

typescript
@Model()
export class EventModel {
  @ObjectId('id')
  _id: string;
}

Released under the MIT License.