C'est simple, changez simplement votre schéma.
https://mongoplayground.net/p/npSvVzbnsyk
{
"name": "device1",
"modules": [
{
"k": "camera",
"v": 3
}
]
},
{
"name": "device2",
"modules": [
{
"k": "wifi",
"v": 3
},
{
"k": "camera",
"v": 2
}
]
},
{
"name": "device3",
"modules": [
{
"k": "wifi",
"v": 2
}
]
}
db.collection.find({"modules.v": 3})