Answers for "model/user mern"

0

model/user mern

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
-----
const userSchema = new Schema({
    name: {
        type: String,
        required: true
    },
    email: {
        type: String,
        required: true
    }
})
module.exports = mongoose.model("User", userSchema, "users")
Posted by: Guest on July-16-2021

Browse Popular Code Answers by Language