【发布时间】:2016-11-23 16:48:31
【问题描述】:
我是 ExpressJs 和 NodeJS 的新手。我正在尝试将我的 userInformation 获取到 Appointment 架构。如何从约会模式访问我的用户模式?我很确定我们将不得不使用填充,但我不知道如何使用它
约会架构
var appointmentSchema = mongoose.Schema({
userId: String,
visitType : String,
timeDuration : String,
startTime : Date,
endTime : Date,
status : String
});
用户架构:
var userSchema = mongoose.Schema({
_id : String,
prefix : String,
firstName : String,
middleName : String,
lastName : String,
dob : String,
age : Number,
gender : String
});
提前致谢
【问题讨论】:
标签: mongoose mongoose-populate