Last active
August 29, 2015 14:14
-
-
Save DouglasHennrich/854998179b045e476a59 to your computer and use it in GitHub Desktop.
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
var mongoose = require( 'mongoose' ); | |
var Schema = mongoose.Schema; | |
var CourseSchema = new Schema({ | |
courseName : { type : String, default: '' } | |
, description : { type : String, default: '' } | |
, videos : { type : Array, default: [] } // Pensei em deixar a ordem cresc para o video | |
// mais novo ficar no final e para só ir dando push nesse array quando tiver | |
// novos videos. | |
, students: [{ type : Schema.Types.ObjectId, ref : 'Student' }] // Alunos autorizados | |
, created_at : { type : Date, default: Date.now } | |
}); | |
module.exports = mongoose.model( "Course", 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
var mongoose = require( 'mongoose' ); | |
var Schema = mongoose.Schema; | |
var TeacherSchema = new Schema({ | |
name : { type : String, default '', required: true } | |
, courses : [{ type : Schema.Types.ObjectId, ref : 'Course' }] | |
, abilities : { type : Array, default: [] } // Habilidades em MEAN, PHP, JQuery.. para ter um info do professor | |
, created_at : { type : Date, default: Date.now } | |
}); | |
module.exports = mongoose.model( "Teacher", TeacherSchema ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment