-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small commit due to laptop concerns
- Loading branch information
Takuya Toyokawa
committed
Oct 21, 2022
1 parent
af3fad0
commit 73b2cb1
Showing
5 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const mongoose = require('mongoose') | ||
|
||
const CourseSchema = new mongoose.Schema({ | ||
title: { | ||
type: String, | ||
trim: true, | ||
required: [true, 'Please add a course title'] | ||
}, | ||
description: { | ||
type: String, | ||
required: [true, 'Please add a description'] | ||
}, | ||
weeks: { | ||
type: String, | ||
required: [true, 'Please add number of weeks'] | ||
}, | ||
tuition: { | ||
type: Number, | ||
required: [true, 'Please add a tuition cost'] | ||
}, | ||
minimumSkill: { | ||
type: String, | ||
required: [true, 'Please add a minimum skill'], | ||
enum: ['beginner', 'intermediate', 'advanced'] | ||
}, | ||
createdAt: { | ||
type: Date, | ||
default: Date.now | ||
}, | ||
bootcamp: { | ||
type: mongoose.Schema.ObjectId, | ||
// Reference to Schema, not database | ||
ref: 'Bootcamp', | ||
required: true | ||
} | ||
}) | ||
|
||
module.exports = mongoose.model('Courses', CourseSchema) |
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