如题所述
第1个回答 2017-04-09
var mongoose=require("mongoose");
mongoose.connect("mongodb://localhost/mydb01");
var User=mongoose.model("User",{
id:Double,//报错指向这里,说 Double is not defined
name:{
type:String,
trim:true
},
});
var user=new User({
id:23,
name:" xiaoming "
})
console.log(user)本回答被提问者采纳
mongoose.connect("mongodb://localhost/mydb01");
var User=mongoose.model("User",{
id:Double,//报错指向这里,说 Double is not defined
name:{
type:String,
trim:true
},
});
var user=new User({
id:23,
name:" xiaoming "
})
console.log(user)本回答被提问者采纳