Skip to content

Commit

Permalink
📊 model struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoinegtir committed Aug 1, 2023
1 parent 869628c commit 83c303b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/models/user.model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const mongoose = require('mongoose')

const userSchema = new mongoose.Schema({
email: { type: String, required: true },
password: { type: String, required: true },
displayName: { type: String, required: true },
birthday: { type: String, required: true },
status: { type: String, default: 'Online' },
username: { type: String, required: true, unique: true },
bio: { type: String, required: false },
profilePic: {
type: String,
default:
'https://archive.org/download/discordprofilepictures/discordgrey.png',
},
createdAt: { type: Date, default: Date.now },
})

const User = mongoose.model('User', userSchema)

module.exports = User

0 comments on commit 83c303b

Please sign in to comment.