# Filter with eq list argument behaves differently without index

**URL:** <https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571>\
**Category:** Dgraph\
**Tags:** dgraph, kind:enhancement, status:accepted, area:querylang\
**Created:** [June 30, 2020, 7:53am UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571 "2020-06-30T07:53:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [June 30, 2020, 7:53am UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571/1 "2020-06-30T07:53:49Z")

</div>

**Moved from GitHub [dgraph/5767](https://github.com/dgraph-io/dgraph/issues/5767)**

_Posted by_ [danielmai](https://github.com/danielmai):

### What version of Dgraph are you using?

v20.03.3

### Have you tried reproducing the issue with the latest release?

Yes

### What is the hardware spec (RAM, OS)?

Ubuntu Linux, Docker

### Steps to reproduce the issue (command/config used to run Dgraph).

1. Run Dgraph cluster

2. Set the following schema with a string predicate:

3. Run the following mutation

4. Run the following query

### Expected behaviour and actual result.

The actual query result is:

```auto
{
  "data": {
    "q": [
      {
        "connects": [
          {
            "name": "B"
          }
        ]
      }
    ]
  }
}

```

The expected query result is that `eq(name, ["A", "B"])` in the filter returns back both nodes A and B in the response.

If I set an index on the name predicate, then the filter works as expected.

Alter schema:

```auto
name: string @index(hash) .

```

Query response:

```auto
{
  "data": {
    "q": [
      {
        "connects": [
          {
            "name": "A"
          },
          {
            "name": "B"
          }
        ]
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [June 30, 2020, 7:56am UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571/2 "2020-06-30T07:56:07Z")

</div>

[danielmai](https://github.com/danielmai) _commented_ :

Either the non-indexed behavior should align with the indexed behavior or we need to update the `eq()` [docs](https://dgraph.io/docs/query-language/#equal-to) to state that `eq(predicate, [val1, val2, ..., valN])` only works with indexed predicates.

---

<div class="post-metadata">

**Author:** ![mbn18](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mbn18/32/1139_2.png) [@mbn18](https://discuss.dgraph.io/u/mbn18)\
**Post date:** [November 3, 2020, 9:53am UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571/3 "2020-11-03T09:53:55Z")

</div>

Hey team, any news about this?  
Its kinda crippling that `[predicate, "val1", "val2", "valN"]` is not working on unindexed data.

---

<div class="post-metadata">

**Author:** ![omar](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/omar/32/2869_2.png) [@omar](https://discuss.dgraph.io/u/omar)\
**Post date:** [November 25, 2020, 3:12pm UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571/4 "2020-11-25T15:12:36Z")

</div>

Hi @mbn18,

I’d like to inform you that this issue is fixed by this [PR](https://github.com/dgraph-io/dgraph/pull/6986). This fix will be part of Dgraph v20.03.7, 20.07.3 and 20.11

Best,  
Omar
