JavaScript
var questionsSchema = new mongoose.Schema({
question: String,
Answers: [{
answerSummary: String,
answer: String,
answerExtended: String,
image: String,
source: String,
date: String,
}],
});
var question = mongoose.model("question", questionsSchema);
我想显示字符串answerSummary
。我尝试了这个没有成功:
<%= question.Answers.answerSummary%>
帮助?
答案 0 :(得分:0)
答案是一个数组,因此必须明确指定要获取数组的位置。
question.Answers[0].answerSummary