# ObjectID Decorator

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

# Overview

function ObjectID(name?: string): Function;

# Description

Tell Mongoose whether to define an ObjectId property.

# Example

@Model()
export class EventModel {
  @ObjectId('id')
  _id: string;
}
1
2
3
4
5