Our table has a nested map roles like this:
{group: 123, roles: {boss: department1, manager: department2}}
Now I want to find all documents in group 123 who has a role in department1. How can I filter based on the value field of the nested map? Something like:
{
"query": {
"bool": {
"must": [
{
"match": {
"group": "123"
}
},
{
"nested": {
"path": "roles",
"query": {
"match": {
"roles.???": "department1"
}
}
}
}
]
}
}
}
I know how to filter by nested object keys but could not find out filtering by "object value".