【发布时间】:2019-10-09 19:01:46
【问题描述】:
我正在尝试使用 nodeJS 中的 mongoose 从“响应”mongoDB 中获取“答案”列表,其中“目标”数组还包含“意识”和特定的“项目 ID”。但它会返回所有列表。
Response.find({projectId: req.params.projectId,"answers.objectives": "Awareness"})
.populate()
.then(survey => {
res.json(survey);
}));
【问题讨论】:
-
答案是数组而不是对象检查docs.mongodb.com/manual/tutorial/query-arrays
标签: arrays node.js json mongoose