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 ... –
致谢!你节省了我的一天 –