问题描述用mongoose创建了一个学生Schame,但是运行的时候报错,错误在第三行的Schema;TypeError: schema is not a constructor看了代码没找到错,请大家帮忙看看,谢谢!相关代码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, //学号
oldpassword:String, //旧密码
newpassword:String, //新密码
phonenum:String, //手机号
course:[courseInf] //课程});module.exports.stu = mongoose.model('student',student);
添加回答
举报
0/150
提交
取消