1
我想弄清楚如何選擇符合Mongoose標準的數組中的某些對象。在數組中的Mongoose布爾查詢返回所有記錄
假設以下記錄:
var Record = {
records : [{name : "you can't look', isPublic : false},
{name : "ok you can look', isPublic : true},
{name : "you can look here too', isPublic : true}]
}
而下面的查詢:
Record.find({'records.isPublic' : true}, function (error, response) {
//This returns all the records, rather than just 0 and 2.
});
任何想法,將不勝感激。