【发布时间】:2018-12-30 00:33:07
【问题描述】:
这是我的用户架构:
const userSchema = new Schema({
email: String,
username: String,
password: String,
secretToken: String,
active: Boolean,
type: String
},{
timestamps: { // this will give us the detail when the account is created
createdAt: 'createdAt',
updatedAt: 'updatedAt'
}
});
这是我的要求架构:
const requirementsSchema = new Schema({
name: String,
age: String,
class: String,
subject: String,
email: String
},{
timestamps: { // this will give us the detail when the requiremnt is created
createdAt: 'createdAt',
updatedAt: 'updatedAt'
}
});
如何将用户架构中的 id 作为辅助键带入需求架构?
【问题讨论】:
标签: mongodb mongoose schema primary-key