File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,12 @@ Once you've registered the schema, you can inject a `Cat` model into the `CatsSe
138
138
import { Model } from ' mongoose' ;
139
139
import { Injectable } from ' @nestjs/common' ;
140
140
import { InjectModel } from ' @nestjs/mongoose' ;
141
- import { Cat , CatDocument } from ' ./schemas/cat.schema' ;
141
+ import { Cat } from ' ./schemas/cat.schema' ;
142
142
import { CreateCatDto } from ' ./dto/create-cat.dto' ;
143
143
144
144
@Injectable ()
145
145
export class CatsService {
146
- constructor (@InjectModel (Cat .name ) private catModel : Model <CatDocument >) {}
146
+ constructor (@InjectModel (Cat .name ) private catModel : Model <Cat >) {}
147
147
148
148
async create(createCatDto : CreateCatDto ): Promise <Cat > {
149
149
const createdCat = new this .catModel (createCatDto );
@@ -259,7 +259,7 @@ If you are just looking to inject the model from a named database, you can use t
259
259
@@filename (cats .service )
260
260
@Injectable ()
261
261
export class CatsService {
262
- constructor (@InjectModel (Cat .name , ' cats' ) private catModel : Model <CatDocument >) {}
262
+ constructor (@InjectModel (Cat .name , ' cats' ) private catModel : Model <Cat >) {}
263
263
}
264
264
@@switch
265
265
@Injectable ()
You can’t perform that action at this time.
0 commit comments