24 lines
543 B
JavaScript
24 lines
543 B
JavaScript
|
|
/* This is the database schema definition for the User Collection in Mongo DB */
|
|
|
|
const mongoose = require('mongoose')
|
|
const Schema = mongoose.Schema
|
|
|
|
const userSchema = new Schema({
|
|
authId: String,
|
|
alias: String,
|
|
firstName: String,
|
|
middleName: String,
|
|
lastName: String,
|
|
email: String,
|
|
emailVerified: Boolean,
|
|
bio: String,
|
|
isDeveloper: Boolean,
|
|
isTrader: Boolean,
|
|
isDataAnalyst: Boolean,
|
|
roleId: String
|
|
})
|
|
|
|
global.UserSchema = global.UserSchema || mongoose.model('User', userSchema)
|
|
module.exports = global.UserSchema
|