How does DQL judge whether a predicate has duplicate values in dgraph?

Values within a list type for a predicate are actually hashed. So

type Person {
  name: [String]
}
<1> <name> "AnthonyMaster"
<1> <name> "Anthony"
...

would all be stored inside a list for <1>, <name>

So <1>, <name> => [ hash<Anthony Master>, hash<Anthony>, ... ]

Therefore duplicate values hash to the same key and the add operation on list type [ ] behaves like a set.

1 Like