Skip to content

Instantly share code, notes, and snippets.

@benjaminadk
Created July 31, 2017 01:56
Show Gist options
  • Save benjaminadk/44e8efbfb39ce1cc1d852991d19a1fb5 to your computer and use it in GitHub Desktop.
Save benjaminadk/44e8efbfb39ce1cc1d852991d19a1fb5 to your computer and use it in GitHub Desktop.
my thoughts on schema
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