Skip to content

Instantly share code, notes, and snippets.

@jboxman
Created December 19, 2017 23:07
Show Gist options
  • Select an option

  • Save jboxman/984e646f14401f09c0737939813eeffe to your computer and use it in GitHub Desktop.

Select an option

Save jboxman/984e646f14401f09c0737939813eeffe to your computer and use it in GitHub Desktop.
bears11Models
const projectSchema = mongoose.Schema({
title: {
type: String,
required: true
},
description: {
type: String,
required: false
},
projectLevel: {
type: String,
required: true,
enum: ['Tier 1', 'Tier 2', 'Tier 3']
},
// What would these values be?
projectType: {
type: String,
required: true,
enum: []
},
// There is a npm module that works extremely well for URL validation we can use for validating this
projectUrl: {
type: String,
required: false
}
});
const userSchema = mongoose.Schema({
username: {
type: String,
required: true
},
email: {
type: String,
required: true
},
avatarUrl: {
type: String
},
oauthId: {
type: String,
required: true,
select: false
},
oauthProvider: {
type: String,
required: true,
enum: ['github'],
select: false
},
completedProjects: {
type: [mongoose.Schema.Types.ObjectId],
ref: 'Projects'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment