# How to perform in query on Hash query

**URL:** <https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751>\
**Category:** Users\
**Tags:** example\
**Created:** [January 6, 2020, 6:47am UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751 "2020-01-06T06:47:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bqf9979](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/bqf9979/32/2393_2.png) [@bqf9979](https://discuss.dgraph.io/u/bqf9979)\
**Post date:** [January 6, 2020, 6:47am UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/1 "2020-01-06T06:47:34Z")

</div>

How to perform in query on Hash query? Just like in (“xxx1”, “XXX2”) in SQL statement, I can’t find relevant content in the document. Although regular query can replace it, I’m worried about efficiency

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [January 6, 2020, 3:30pm UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/2 "2020-01-06T15:30:27Z")

</div>

This question isn’t clear to me. Can you elaborate more? With examples.

Cheers.

---

<div class="post-metadata">

**Author:** ![bqf9979](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/bqf9979/32/2393_2.png) [@bqf9979](https://discuss.dgraph.io/u/bqf9979)\
**Post date:** [January 6, 2020, 3:38pm UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/3 "2020-01-06T15:38:21Z")

</div>

For example, I have a predicate that is hash indexed. I can use EQ to query exactly one predicate. If I want to query 10 predicates at a time, what statement should I use? For example:  
EQ (name, (“Jim”, “Tom”, “Lucy”)), this syntax is not correct, but I want to know the correct way to write

---

<div class="post-metadata">

**Author:** ![bqf9979](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/bqf9979/32/2393_2.png) [@bqf9979](https://discuss.dgraph.io/u/bqf9979)\
**Post date:** [January 6, 2020, 3:39pm UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/4 "2020-01-06T15:39:15Z")

</div>

It means how to match “Jim”, “Tom” and “Lucy” exactly at the same time

---

<div class="post-metadata">

**Author:** ![dpk](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@dpk](https://discuss.dgraph.io/u/dpk)\
**Post date:** [January 6, 2020, 5:54pm UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/5 "2020-01-06T17:54:10Z")

</div>

I think this will do what you want: `eq(name, ["Jim", "Tom", "Lucy"])`.

It works in my testing using Dgraph 1.1.1 and is documented here: [https://docs.dgraph.io/master/query-language/#inequality](https://docs.dgraph.io/master/query-language/#inequality)

FWIW, you can also use `eq(name, "Jim", "Tom", "Lucy")` without the brackets, but that’s not documented and therefore probably shouldn’t be relied upon. Plus, the brackets are easier to parse visually, IMO.

---

<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:** [February 5, 2020, 5:54pm UTC](https://discuss.dgraph.io/t/how-to-perform-in-query-on-hash-query/5751/6 "2020-02-05T17:54:20Z")

</div>

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