0
我有一个看起来像这样的结构:Loopback.js/Node.js的MongoDB的 - 对查询数组
Model: {
"name":"testing",
"details":["detail1","detail2","detail10"]
}
一个人如何去寻找其中的上述结构包含内detail2
一个实例的所有实例他们的详细信息property
?我已经试过:
Model.find({where:{details:{elemMatch:{"detail2"}}}},function(err,models){
console.log(models);
console.log(err);
});
和:
Model.find({details:"detail2"},function(err, models){
//throws [Error: Items must be an array: "details2"]
});
感谢您指出了这一点! – hownowbrowncow