我的userSchema如下
import * as mongoose from 'mongoose';
import * as passportLocalMongoose from 'passport-local-mongoose';
export const UserSchema = new mongoose.Schema({
firstName: String,
lastName: String,
email: String,
password: String,
});
UserSchema.plugin(passportLocalMongoose);
我的用户界面如下
import { PassportLocalDocument } from 'mongoose';
export interface IUser extends PassportLocalDocument {
readonly firstName: string;
readonly lastName: string;
readonly email: string;
readonly password: string;
}
我想创建我的用户模型的实例,该实例的类型应该为PassportLocalModel 这样我就可以在UserServices中创建CRUD函数。我不知道如何创建该实例