# How do I query for an empty string?

**URL:** <https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198>\
**Category:** Users\
**Created:** [February 2, 2018, 11:14pm UTC](https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198 "2018-02-02T23:14:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rokett](https://avatars.discourse-cdn.com/v4/letter/r/e36b37/32.png) [@rokett](https://discuss.dgraph.io/u/rokett)\
**Post date:** [February 2, 2018, 11:14pm UTC](https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198/1 "2018-02-02T23:14:11Z")

</div>

Hi,

I’m having trouble querying for data where a predicate is an empty string.

The scenario here is that I have some data where the value is an empty string and I need to find that data. For example:

```auto
{
  "data": {
    "rooms": [
      {
        "name": "room 1"
      },
      {
        "name": "room 2"
      },
      {
        "name": ""
      }
    ]
  }
}

```

and I want to get a count of rooms which do not have a name.

```auto
{
  rooms(func: has(room)) {
    count(room @filter(eq(room, "")))
  }
}

```

But that returns `Empty argument received`. I tried replacing the string with `"_nil_"` (read that somewhere), but although it doesn’t error it doesn’t return a count of rooms without a name either.

Is there a way to search for empty strings?

Thanks!

---

<div class="post-metadata">

**Author:** ![pawan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pawan/32/1946_2.png) [@pawan](https://discuss.dgraph.io/u/pawan)\
**Post date:** [February 5, 2018, 1:20am UTC](https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198/2 "2018-02-05T01:20:24Z")

</div>

This should be possible. Could you create a Github issue for this and we’ll make sure it works!

---

<div class="post-metadata">

**Author:** ![sboorlagadda](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sboorlagadda](https://discuss.dgraph.io/u/sboorlagadda)\
**Post date:** [February 10, 2018, 9:43pm UTC](https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198/3 "2018-02-10T21:43:54Z")

</div>

Created this [issue](https://github.com/dgraph-io/dgraph/issues/2108) on github.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [March 12, 2018, 9:44pm UTC](https://discuss.dgraph.io/t/how-do-i-query-for-an-empty-string/2198/4 "2018-03-12T21:44:05Z")

</div>

Closed on March 12, 2018, 9:44pm UTC

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