Created
July 31, 2017 01:56
-
-
Save benjaminadk/44e8efbfb39ce1cc1d852991d19a1fb5 to your computer and use it in GitHub Desktop.
my thoughts on schema
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 userSchema = mongoose.Schema( | |
{ | |
login: loginSchema | |
profile: profileSchema | |
skillTree: skillSchema | |
}) | |
const loginSchema = mongoose.Schema( | |
{ | |
username: { | |
type: String, | |
trim: true, | |
unique: true, | |
required: true | |
}, | |
password: { | |
type: String, //(will be hashed i think,right?) | |
required: true | |
} | |
}) | |
const profileSchema = mongoose.Schema( | |
{ | |
email: { //(might go into login schema) | |
type: String, | |
trim: true, | |
unique: true, | |
required: true | |
}, | |
bio: String, | |
gender: String, | |
profile_pic: String, //(link to filestorage?) | |
profile_pic: String | |
}) | |
const skillSchema = mongoose.Schema( | |
{ | |
html: htmlSchema | |
css: cssSchema | |
js: jsSchema | |
}) | |
const htmlSchema = mongoose.Schema( | |
{ | |
overall: Number, | |
subskill: Number, | |
subskill: Number | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment