Hi I have this document in ES with nested type:
{
"id": "92210f7f-b8a4-4d55-877d-8708154aa004",
"additionalData": {
"devices_nested": [
{
"version_string": "1"
},
{
"os_string": "Windows",
"version_string": "3"
},
{
"os_string": "Centos"
}
]
}
I want to do query that additionalData.devices_nested does not contain any element where os_string property does not exist that means I want to avoid such documents where some entries could have or not os_string property. Here is my query:
{
"query": {
"nested": {
"query": {
"bool": {
"must": {
"exists": {
"field": "additionalData.devices_nested.os_string"
}
}
}
},
"path": "additionalData.devices_nested"
}
}
}
But I always get the example document as result because at least one element satisfies query that there is os_string property. Is it possible to make query which will return document where all elements in devices_nested has os_string property?