Mongoose schema/model using typescript Mongoose schema/model using typescript mongoose mongoose

Mongoose schema/model using typescript


You should be able to say something like the following:

export var UserModel = <IUserModel>M.model('user', userSchema);

Then you will have proper typechecking/intellisense when you reference the UserModel.