Created
May 16, 2020 07:13
-
-
Save mohanramphp/cb2ea097476763ab899e8da17b3700f9 to your computer and use it in GitHub Desktop.
User model declaration
This file contains 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 mongoose = require("mongoose"); | |
const userSchema = new mongoose.Schema({ | |
name: { | |
type: String, | |
required: true, | |
min: 6, | |
max: 255, | |
}, | |
email: { | |
type: String, | |
required: true, | |
min: 6, | |
max: 255, | |
}, | |
password: { | |
type: String, | |
required: true, | |
min: 6, | |
max: 1024, | |
}, | |
date: { | |
type: Date, | |
default: Date.now, | |
}, | |
}); | |
module.exports = mongoose.model("User", userSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment