我想获取nameValue
中由该特定模式定义的每个文档的emailValue
,addressValue
,cardname
和mongoose
的数据。它将生成一个ID,我是否必须遍历该ID并从数据库中获取所有所需的数据字段?
RegisterModelSchema = new Schema({
cred: {
nameValue: {
type: String,
required: true,
},
emailValue: {
type: String,
required: true,
},
passwordValue: {
type: String,
required: true,
},
},
location: {
addressValue: {
type: String,
required: true,
},
cityValue: {
type: String,
required: true,
},
stateValue: {
type: String,
required: true,
},
postalValue: {
type: Number,
required: true,
},
},
card: {
cardName: {
type: String,
required: true,
},
cardNumber: {
type: Number,
required: true,
},
securityCode: {
type: Number,
required: true,
},
expirationMonth: {
type: Number,
required: true,
},
expirationYear: {
type: Number,
required: true,
},
}