Check out example codes for "exists query elasticsearch 5.4". It will help you in understanding the concepts better.

Code Example 1

GET /_search
{
    "query": {
        "exists": {
            "field": "user"
        }
    }
}

Code Example 2

GET /_search
{
    "query": {
        "bool": {
            "must_not": {
                "exists": {
                    "field": "user"
                }
            }
        }
    }
}

Learn ReactJs, React Native from akashmittal.com