you can extend the Document type by creating an intersection type like this export type UserDocument = User & Document;and then pass the UserDocument type when you inject in your service. This is assuming you're using the InjectModel decorator that from the nestjs/mongose module. An example of what you would pass into your user service constructor would look like this @InjectModel(User.name) private readonly userModel: Model<UserDocument>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
you can extend the Document type by creating an intersection type like this
export type UserDocument = User & Document;
and then pass the UserDocument type when you inject in your service. This is assuming you're using the InjectModel decorator that from the nestjs/mongose module. An example of what you would pass into your user service constructor would look like this@InjectModel(User.name) private readonly userModel: Model<UserDocument>