Query document array is a subset of search input

If type arra_attr is nested, you can do like this post.

{
  "query": {
    "bool": {
      "must_not": [
        {
          "nested": {
            "path": "array_attr",
            "query": {
              "bool": {
                "must_not": [
                 {
                   "terms": {
                     "array_attr.id.keyword": [
                       "A",
                       "B",
                       "C",
                       "D"
                     ]
                   }
                 }
                ]
              }
            }
          }
        }
      ]
    }
  }
}