Schema
@tsed/mongoose
Usage
typescript
import { Schema } from "@tsed/mongoose";
Overview
ts
function Schema(options?: MongooseSchemaOptions): (target: any) => void;
export function Schema(definition: SchemaTypeOptions<any>): Function;
Description
Define a class as a Mongoose Schema ready to be used to compose other schemes and models.
Example
typescript
@MongooseSchema()
export class EventSchema {
@Property()
field: string;
}
Options
schemaOptions
(mongoose.SchemaOptions): Option to configure the schema behavior.