Initialize User model to creat index
This commit is contained in:
1 parent
9a3b6dc98a
commit
32101b4c2f
1 file changed
+6
@@ -70,4 +70,10 @@ UserSchema.methods.comparePassword = async function (submittedPassword) {
|
||||
return res;
|
||||
};
|
||||
|
||||
const User = mongoose.model("User", UserSchema);
|
||||
|
||||
User.init().then(() => {
|
||||
console.log("User model initialized");
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("User", UserSchema);
|
||||
Reference in new issue
Block a user