Consider the following document:
{
"_id": 1,
"properties": [
{
"key": "foobar",
"value": null
},
{
"key": "xxx",
"value": "yyy"
}
]
}
The properties are indexed:
db.collections.ensureIndex('properties')
I want to find all documents where the value for the key foobar is null.
While this query does find all elements where the value has the desired value:
db.collections.find({ properties: { key: 'xxx', value: 'yyy' } })
The following does not return any results:
db.collections.find({ properties: { key: 'foobar', value: null } })
Thanks for your help!