問題描述用mongoose創(chuàng)建了一個學(xué)生Schame,但是運(yùn)行的時候報(bào)錯,錯誤在第三行的Schema;TypeError: schema is not a constructor看了代碼沒找到錯,請大家?guī)兔纯?,謝謝!相關(guān)代碼var mongoose = require('mongoose'),
Schema = mongoose.Schema;const courseInf = new Schema({
teacher:String,
courseName:String});const student = new Schema({
name:String, //姓名
class:String, //班級
stunum:String, //學(xué)號
oldpassword:String, //舊密碼
newpassword:String, //新密碼
phonenum:String, //手機(jī)號
course:[courseInf] //課程});module.exports.stu = mongoose.model('student',student);
TypeError: schema is not a constructor?
紅顏莎娜
2018-09-02 09:14:48