Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mongoose = require('mongoose');
- // *** NOTE: You never want to store a plain password in production! If someone gains access to your database, they will have access to all the users passwords.
- // You can use something like PassportJS to handle saving passwords
- const UserSchema = new mongoose.Schema({
- username: {
- type: String,
- default: '',
- },
- password: {
- type: String,
- default: '',
- },
- email: {
- type: String,
- default: 'N/A',
- },
- registerDate: {
- type: Date,
- default: Date.now(),
- },
- });
- module.exports = mongoose.model('User', UserSchema);
Add Comment
Please, Sign In to add comment