# createModel Function
Module | import { createModel } from "@tsed/mongoose" |
---|---|
Source | /packages/mongoose/src/utils/createModel.ts |
# Overview
function createModel<T>(target: any, schema: mongoose.Schema, name?: string, collection?: string, skipInit?: boolean, connection?: Connection): mongoose.Model<mongoose.Document, {}>;
Param | Type | Description |
---|---|---|
target | Type<any> | Class attached to the schema and model. schema |
# Description
Create an instance of mongoose.model from a class.
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing