"features" : {
"en" : [
{
"translatable" : true,
"capacity " : [
"128GB",
"256GB"
]
},
{
"translatable" : true,
"material " : [
"Glass",
"Aluminium"
]
}
]
}
当我使用这个查询时,我发现 'capacity': '128GB'
db.getCollection('products').find({
'features.en' : {
$elemMatch : {
'capacity' : {
$in : ['128GB']
}
}
}
})
但是没有获取到数据。 如果我查询“translatable:true”
db.getCollection('products').find({
'features.en' : {
$elemMatch : {
'translatable' : true
}
}
})