2
我剛開始與貓鼬和有問題找到的元素...貓鼬發現元素數組
我的架構包含subregions
從中我想找到它的code
匹配的一個數組。該架構如下:
var schema = {
name: {
type: String,
required: true
}
...
subRegions: [{
name: {
type: String,
required: true
},
code: {
type: String,
required: true
}
}]
...
};
我想出了
find({
subRegions: {
"$in": [{
code: regionCode
}]
}
}).exec(...)
但是這是不工作...
謝謝。是的,這是它。這是遲到了,我混入東西,因爲我最初在該數組中有ObjectId()s ... –
致謝!你節省了我的一天 –