Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Model untuk pengguna sebagai siswa
- var mongoose = require('mongoose');
- var connection = require('../../database/connection')
- var Schema = mongoose.Schema;
- var UserSchema = Schema({
- email: {type: String, min: 1, max: 100, required: true},
- sandi: {type: String, min: 1, max: 100, required: true},
- peran: {type: Number, required: true},
- mengajar: [
- {
- kelas:{type: Schema.ObjectId, ref: 'kelas'},
- mapel:{type: Schema.ObjectId, ref: 'mapel'}
- }
- ],
- RFID_card : {
- serial_number : {type : String,default : "-"},
- status : {type : String, default : "Non Aktif"}
- },
- Class_data : {
- kelas : [{type: mongoose.Schema.Types.ObjectId, ref: 'kelas', default: '-'}],
- tahun_ajaran :{type : String , require : true}
- },
- Sekolah_data : {
- sekolah_id : {type : String,require : true},
- tahun_ajaran : {type : String,require : true}
- },
- profil : {
- username: {type: String, min: 1, max: 100, required: true},
- nama_lengkap: {type: String, min: 1, max: 100, required: true},
- jenis_kelamin: {type: String, min: 1, max: 100, required: true},
- foto: {type: String, min: 1, max: 100, default: 'http://filehosting.pptik.id/TESISS2ITB/Vidyanusa/default-profile-picture.png'},
- bio: {type: String, min: 1, max: 100, default: '-'}
- }
- },{collection: 'pengguna'});
- module.exports = connection.sekolah_vidyanusa().model('pengguna', UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment