ERROR IN MODEL
const Model = mongoose.Model;
THIS IS WRONG
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const Model = mongoose.model;
const userSchema = new Schema({
name: String,
email: {
type: String,
},
password: {
type: String,
},
});
const user = new Model("user", userSchema);
module.exports = user;

Comments
Post a Comment