-
-
Save ManishPoduval/c5add369f89bde67f9f26f387c9cbecd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Schema, model } = require("mongoose"); | |
// 1. Define your schema | |
let UserSchema = new Schema({ | |
name: String, | |
email: { | |
type: String, | |
required: true | |
}, | |
passwordHash: { | |
type: String, | |
required: true | |
} | |
}) | |
// 2. Define your model | |
let UserModel = model('user', UserSchema) | |
// 3. Export your Model with 'module.exports' | |
module.exports = UserModel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment