How to perform in query on Hash query

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

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

Cheers.

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

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

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

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.

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