# Value does not exist

**URL:** https://discuss.elastic.co/t/value-does-not-exist/274833
**Category:** Elasticsearch
**Created:** [June 3, 2021, 8:23am UTC](https://discuss.elastic.co/t/value-does-not-exist/274833 "2021-06-03T08:23:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kehers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kehers/32/89761_2.png) [@kehers](https://discuss.elastic.co/u/kehers)
#### Post date: [June 3, 2021, 8:23am UTC](https://discuss.elastic.co/t/value-does-not-exist/274833/1 "2021-06-03T08:23:29Z")

</div>

I am familiar with checking if a field exists using the exists query. I am wondering if there is a way to check if a value does not exist instead; something like this:

```auto
GET /_search
{
  "query": {
    "bool": {
      "must_not": {
        "exists": {
          "field": "user",
           "value": "id"
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 7, 2021, 5:55am UTC](https://discuss.elastic.co/t/value-does-not-exist/274833/2 "2021-06-07T05:55:43Z")

</div>

Welcome to our community! 😃

Do you mean you want to return documents that don't have that value?

---

<div class="post-metadata">

### Author: ![kehers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kehers/32/89761_2.png) [@kehers](https://discuss.elastic.co/u/kehers)
#### Post date: [June 7, 2021, 2:04pm UTC](https://discuss.elastic.co/t/value-does-not-exist/274833/3 "2021-06-07T14:04:05Z")

</div>

Thanks @warkolm  
I think another way to explain it is I want to see if the occurrence of the value is 0. I know one way to do this is to use a count query. But it is a compound query and that won't work.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2021, 2:04pm UTC](https://discuss.elastic.co/t/value-does-not-exist/274833/4 "2021-07-05T14:04:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
