我在这个项目中使用了expressjs,mongodb和ejs。填充dbs后,数据如下所示:
{
_id: 5645646464,
price: 15000,
sellerId: {
_id: 3543453242,
Name: 'MrJohn'
},
name: 'House of MrJohn',
category: '1'
}
现在在使用EJS的html中,我想要打印" MrJohn"在我的seller
专栏中,我尝试了这个:
<%=data[i].sellerId.Name%>
但它会返回undefined
。