我有一个嵌套数组的架构,如下所示:
personaldetails:[{candidatename:String,
permanentaddress:String,
dob:Date,
email:{type:String, unique:true},
mobile:String,
}],
educationaldetails:[{
highschool:[{
course:String,
}],
seniorsecondaryschool:[{
course:String,
}],
undergraduation:[{
course:String,
}],
postgraduation:[{
course:String,
}],
}]
在这一切都很完美的问题是,我无法显示从mongodb到ejs模板的获取数据。
我试过
<% for(var i=0; i<data.personaldetails.length; i++) {%>
<%= data.personaldetails[i].candidatename%>
and so no...
<%}%>
请帮我做同样的事情......