Created
December 19, 2017 23:07
-
-
Save jboxman/984e646f14401f09c0737939813eeffe to your computer and use it in GitHub Desktop.
bears11Models
This file contains hidden or 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 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 | |
| } | |
| }); |
This file contains hidden or 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({ | |
| 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